Click to See Complete Forum and Search --> : Triple onunload dilemma


Fess
04-04-2003, 06:09 PM
Hello,

I have this triple exit console script:

<!Begin Triple Exit Code -->
<SCRIPT language="JavaScript">var exit=true; function at()
{ if (exit)
open('page1.htm');
open('page2.htm');
open('page3.htm');
} </SCRIPT>
<!End Triple Exit Code -->

onunload="at()"

I want to have control over the dimensions of the pops. I tried modifing the code with something like this:

<SCRIPT language="JavaScript">
var exit=true; function at() { if
(exit) open('page1.htm', "displayWindow", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");
open('page3.htm', "displayWindow", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");
open('page4.htm', "displayWindow", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");
} </SCRIPT>

But only the first popup excutes and nothing else. I'm not too javascript savvy. Can someone please help me out?

Thank You
Fess

Esch
04-04-2003, 06:19 PM
give your popup windows different names, otherwise your trying to open a window which is already open.

Fess
04-05-2003, 10:48 AM
Hey Esch,

Thanks for the tip. It worked! I was also missing a few squiggle brackets. The funtional code is :

<!Begin Triple Exit Code -->
<SCRIPT language="JavaScript">var exit=true; function at() {
if (exit){
open('page1.htm', "displayWindow1", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");
open('page2.htm', "displayWindow2", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");
open('page3.htm', "displayWindow3", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=60,height=60");}
} </SCRIPT>
<!End Triple Exit Code -->

Thanks again
Regards
Fess