Paul Jr
12-11-2003, 11:48 PM
I'm attempting to create an array with a list of links in it, then open them all up as popups using a for loop.
I have this so far:
<script type="text/javascript">
var windows = new Array(10)
windows[0] = "www.teenchat.com"
windows[1] = "www.google.com"
windows[2] = "www.yahoo.com"
windows[3] = "www.php.net"
windows[4] = "www.microsoft.com"
windows[5] = "www.w3schools.com"
windows[6] = "www.w3.org"
windows[7] = "www.westciv.com"
windows[8] = "www.htmlgoodies.com"
windows[9] = "www.aspfreeserver.com"
for (i=0; i<10; i++) {
window.open(windows[i]);
}
</script>
The problem is, the windows don't open correctly.
Let's say the page containing this code is www.aspfreeserver.com/pauljr/popup.html. What's going to happen is the windows are going to popup with the url of www.aspfreeserver.com/pauljr/popup.html/urlofpopupwindow.
I don't want that, I just want them to open like a normal popup, without the www.aspfreeserver.com/pauljr/popup.html
Eh, I'm incredibly new to JavaScript, so... yeah. :D
Thanks for your help.
I have this so far:
<script type="text/javascript">
var windows = new Array(10)
windows[0] = "www.teenchat.com"
windows[1] = "www.google.com"
windows[2] = "www.yahoo.com"
windows[3] = "www.php.net"
windows[4] = "www.microsoft.com"
windows[5] = "www.w3schools.com"
windows[6] = "www.w3.org"
windows[7] = "www.westciv.com"
windows[8] = "www.htmlgoodies.com"
windows[9] = "www.aspfreeserver.com"
for (i=0; i<10; i++) {
window.open(windows[i]);
}
</script>
The problem is, the windows don't open correctly.
Let's say the page containing this code is www.aspfreeserver.com/pauljr/popup.html. What's going to happen is the windows are going to popup with the url of www.aspfreeserver.com/pauljr/popup.html/urlofpopupwindow.
I don't want that, I just want them to open like a normal popup, without the www.aspfreeserver.com/pauljr/popup.html
Eh, I'm incredibly new to JavaScript, so... yeah. :D
Thanks for your help.