really annoying error Please HELP!!!

T

TeknoCat

Hey everyone,

I'm having a problem with some new pages I am creating for the Web site at
www.weaverdevore.ca and I am wondering if anyone here might be able to help.
Here is a full description of the problem:

I keep getting a JavaScript error that occurs when I try to re-open a closed
popup window after it has been opened once with a javascript call. The
message reads:

The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call did not execute.

To see this error reproduced, go to www.weaverdevore.ca/?main2
(This is the temp page I am testing on until it works. Please ignore the
page not found error in the bottom frame.)

Scroll down past the Flash advertisement to find a link labelled "Fraud
Protection Policy." It will open the first time you click on it, but after
closing it once it will produce this error and won't open it again. If you
click on one of products displayed even further down, you will see that
their popup works fine over and over. Also, if you click on any of the other
links that use popups they can all be opened again and again without error.
I tried duplicating popup pages that were working just fine and editing them
to the new format, and still the same thing. The new popup windows I want to
use for the site will be frames pages with a footer frame with print and
close buttons and an info display frame above them. I have tried standard
frames, as well as an inline frame (as the product view window uses). All
produce the same error as a result. I tried making the close button a
"submit" button and the form action a "javascript:parent.close()". I also
tried making the form action "NULL" and using an
onClick="javascript:parent.close()" and still the same error. I duplicated
the product information screen, changed it by modifying the buttons (which
are standard HTML image links, not form buttons) and even though the product
window works, this duplicated one produced the error. Here is the code I
made for the new popup:

function popupWin(name,addy,w,h) {
if ((w == 0) || (h == 0)) {
w = 750;
h = 500;
popupFile = "2";
}
else {
popupFile = "1";
}
LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
TopPosition = (screen.height) ? ((screen.height - h)/2)-50 : 0;
settings =
'width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',status';
popupWin = window.open('http://www.weaverdevore.ca/main-pages/popup' +
popupFile + ".html?" + addy,name,settings);
}

This code is stashed in a .js file, but you can view all the other source
code of any of the pages with a right-click. I cannot see anything wrong
with my code, so if someone has any ideas I would appreciate if they could
please send me an email to (e-mail address removed), even if the reply
is also posted here in the news group.

Thanks in advance,
Peter
 
M

McKirahan

TeknoCat said:
Hey everyone,

I'm having a problem with some new pages I am creating for the Web site at
www.weaverdevore.ca and I am wondering if anyone here might be able to help.
Here is a full description of the problem:

I keep getting a JavaScript error that occurs when I try to re-open a closed
popup window after it has been opened once with a javascript call. The
message reads:

The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call did not execute.

To see this error reproduced, go to www.weaverdevore.ca/?main2


I don't know if this will help but here goes...


Can you get rid of "popup-footer.html"?

If so, then change the "Close" (which currently doesn't work anyway) in
"fraud_protect.html" from:

<form method="POST" action="javascript:self.close()">
<tr>
<td width="100%" class="chart_title" align="center" height="5%">
<input type="submit" value="Close" name="B1"></td>
</tr>
</form>

to

<form>
<tr>
<td width="100%" class="chart_title" align="center" height="5%">
<input type="button" value="Close"
onClick="javascript:self.close();"></td>
</tr>
</form>

You may want to include a Print button:

<input type="button" value="Print" onClick="javascript:self.print();">
 
R

Richard Cornford

function popupWin(name,addy,w,h) {
popupWin = window.open('http://www. ...
<snip>

You are using exactly the same name for the global variable in which you
are storing your window reference as the name of your function. As both
global function declarations and global variables are named properties
of the global object the effect of assigning the window reference to the
property of the global object with the name "popupWin" is to replace the
reference to the function object that it held with the reference to the
new window. Any subsequent attempts to call that function will represent
an attempt to execute a window rather than a function.

Incidentally, when you present code for consideration by humans you
should format that code with one of the common block indenting styles.
If the above error had not been so glaringly obvious I, for one, would
not have bothered to even consider the logic in the rest of the
function, obscured as it is by bad presentation.

Richard.
 
T

TeknoCat

Thanks for pointing that out, I can't believe I didn't notice that myself! Duh!

Regards,
TeknoCat
 
T

TeknoCat

Thanks for the advice. I have it figured out now thanks to someone
else. It was a really stupid error on my part that I should have
noticed. As for the close buttons, they will work once I have solved
the problem. I just didn't worry about making sure they all worked
until the popup worked properly. I will most likely use the onClick
for the window close and window print buttons anyway.

Regards,
TeknoCat


McKirahan said:
TeknoCat said:
Hey everyone,

I'm having a problem with some new pages I am creating for the Web site at
www.weaverdevore.ca and I am wondering if anyone here might be able to help.
Here is a full description of the problem:

I keep getting a JavaScript error that occurs when I try to re-open a closed
popup window after it has been opened once with a javascript call. The
message reads:

The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call did not execute.

To see this error reproduced, go to www.weaverdevore.ca/?main2


I don't know if this will help but here goes...


Can you get rid of "popup-footer.html"?

If so, then change the "Close" (which currently doesn't work anyway) in
"fraud_protect.html" from:

<form method="POST" action="javascript:self.close()">
<tr>
<td width="100%" class="chart_title" align="center" height="5%">
<input type="submit" value="Close" name="B1"></td>
</tr>
</form>

to

<form>
<tr>
<td width="100%" class="chart_title" align="center" height="5%">
<input type="button" value="Close"
onClick="javascript:self.close();"></td>
</tr>
</form>

You may want to include a Print button:

<input type="button" value="Print" onClick="javascript:self.print();">
 
T

TeknoCat

Also, sorry for the lack of indentation in the code I wrote in the
message. I know that makes it difficult, and will keep that in mind
for future.

Regards,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,824
Latest member
Nater888

Latest Threads

Top