Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: opening new window on load


Message #1 by jstmehr4u3@a... on Mon, 19 Aug 2002 20:11:00 +0000
I know you can use the <body onload> syntax, but what if 
you want to load this after the body tag has been 
written?

For instance:

for counter = 0 to 4
  window.open(URL(counter))
next

Now, this should open 4 new windows with 4 seperate 
URLS. But where do I put this code to have it execute on 
load...
Message #2 by "Drew, Ron" <RDrew@B...> on Mon, 19 Aug 2002 17:23:15 -0400
I think this would work...Put the loop in Javascript and execute on the
body load

<script language=3D"JavaScript">
<!--
function newWindow() {
 var x;
 for (x =3D 0; x < 5; x++){
     var
a=3Dwindow.open('window[x].asp','sub','height=3D500,width=3D450,left=3D45
0');
}
//-->
</script>

<Body onLoad=3D"newWindow()">

-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, August 19, 2002 4:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] opening new window on load


I know you can use the <body onload> syntax, but what if
you want to load this after the body tag has been
written?

For instance:

for counter =3D 0 to 4
  window.open(URL(counter))
next

Now, this should open 4 new windows with 4 seperate
URLS. But where do I put this code to have it execute on
load...


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #3 by "Debreceni, David" <david_debreceni@r...> on Tue, 20 Aug 2002 07:26:55 -0400
If you want to execute this after the window loads, you can use the set
timeout function to delay your function execution, then do the script that
Ron put in. 


<script language="JavaScript">
<!-- 
function newWindow() {
 var x;
 for (x = 0; x < 5; x++){
     var
a=window.open('window[x].asp','sub','height=500,width=450,left=450');
}

//Set timer when window loads to call this script.
setTimeout("newWindow()", 1000);
//-->
</script>


 
 
David Debreceni
Senior VB/ASP Developer
David_Debreceni@r... <mailto:David_Debreceni@r...> 
xxx-xxx-xxxx  x1086


-----Original Message-----
From: Drew, Ron [mailto:RDrew@B...]
Sent: Monday, August 19, 2002 5:23 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: opening new window on load


I think this would work...Put the loop in Javascript and execute on the
body load

<script language="JavaScript">
<!-- 
function newWindow() {
 var x;
 for (x = 0; x < 5; x++){
     var
a=window.open('window[x].asp','sub','height=500,width=450,left=450');
}
//-->
</script>

<Body onLoad="newWindow()">

-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...] 
Sent: Monday, August 19, 2002 4:11 PM
To: ASP Web HowTo
Subject: [asp_web_howto] opening new window on load


I know you can use the <body onload> syntax, but what if 
you want to load this after the body tag has been 
written?

For instance:

for counter = 0 to 4
  window.open(URL(counter))
next

Now, this should open 4 new windows with 4 seperate 
URLS. But where do I put this code to have it execute on 
load...


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


  Return to Index