LeDaouk
asked on
Open multiple pages with one hyperlink click
how can we open multiple pages by one lick on hyperlink?
javascript or else?
and can we do it in frames?
javascript or else?
and can we do it in frames?
:P can i play?
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
var url1 = "http://www.yahoo.com";
var url2 = "http://www.google.com";
var url3 = "http://www.cnn.com";
var url4 = "http://www.test.com";
var url5 = "http://www.mozilla.org";
// -->
</script>
</head>
<body>
<a href="#" onclick="window.open(url1) ;window.op en(url2);w indow.open (url3);win dow.open(u rl4);windo w.open(url 5);return false;">Open Window :P</a>
</body>
</html>
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
var url1 = "http://www.yahoo.com";
var url2 = "http://www.google.com";
var url3 = "http://www.cnn.com";
var url4 = "http://www.test.com";
var url5 = "http://www.mozilla.org";
// -->
</script>
</head>
<body>
<a href="#" onclick="window.open(url1)
</body>
</html>
ASKER
thanks jaysolomon
but could u tell me can can we load them each one in a frame the same time
but could u tell me can can we load them each one in a frame the same time
<a href="#" onclick="window.frames['fr ame1Name'] .src = url1;window.frames['frame2 Name'].src = url2;..................and so forth
I do not use frames so i cannot test this
I do not use frames so i cannot test this
ASKER
I used the same code
<a href="#" onclick="window.open(url1) ;window.op en(url2);w indow.open (url3);win dow.open(u rl4);windo w.open(url 5);return false;">Open Window :P</a>
open 5 internet browsers with blank Pages, it doesn't open the urls indicated in the script.
am I doing somthing wrong?
<a href="#" onclick="window.open(url1)
open 5 internet browsers with blank Pages, it doesn't open the urls indicated in the script.
am I doing somthing wrong?
My source http://www.htmlhelp.com/design/frames/usage/combining.html
<html>
<head>
<title></title>
</head>
<FRAMESET COLS="50%,50%">
<FRAMESET ROWS="33%,33%,34%">
<FRAME SRC="http://www.yahoo.com" NAME=lefttop>
<FRAME SRC="http://www.google.com" NAME=leftmiddle>
<FRAME SRC="http://www.cnn.com" NAME=leftbottom>
</FRAMESET>
<FRAMESET ROWS="33%,33%,34%">
<FRAME SRC="http://www.test.com" NAME=righttop>
<FRAME SRC="http://www.mozilla.org" NAME=rightmiddle>
<FRAME SRC="http://www.batavg.com" NAME=rightbottom>
</FRAMESET>
</html>
very interesting....
I threw in my little baby to round out the page. :^)
<html>
<head>
<title></title>
</head>
<FRAMESET COLS="50%,50%">
<FRAMESET ROWS="33%,33%,34%">
<FRAME SRC="http://www.yahoo.com" NAME=lefttop>
<FRAME SRC="http://www.google.com" NAME=leftmiddle>
<FRAME SRC="http://www.cnn.com" NAME=leftbottom>
</FRAMESET>
<FRAMESET ROWS="33%,33%,34%">
<FRAME SRC="http://www.test.com" NAME=righttop>
<FRAME SRC="http://www.mozilla.org" NAME=rightmiddle>
<FRAME SRC="http://www.batavg.com" NAME=rightbottom>
</FRAMESET>
</html>
very interesting....
I threw in my little baby to round out the page. :^)
Here is the answer:
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
var urls=new Array("http://www.yahoo.com","http://www.google.com","http://www.cnn.com","http://www.test.com","http://www.mozilla.org");
function openwindows(){
for(i=0;i<urls.length;i++) {
window.open(urls[i],"page" +i);
}
}
// -->
</script>
</head>
<body>
<a href="#" onClick="openwindows();">O pen Windows</a>
</body>
</html>
I shortened the code slightly by putting all the addresses in to an array, and then going through a loop to open up the windows one by one.
I have only tested this in Internet Explorer 6.
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
var urls=new Array("http://www.yahoo.com","http://www.google.com","http://www.cnn.com","http://www.test.com","http://www.mozilla.org");
function openwindows(){
for(i=0;i<urls.length;i++)
window.open(urls[i],"page"
}
}
// -->
</script>
</head>
<body>
<a href="#" onClick="openwindows();">O
</body>
</html>
I shortened the code slightly by putting all the addresses in to an array, and then going through a loop to open up the windows one by one.
I have only tested this in Internet Explorer 6.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Frames cause a lot of problems though - why do you think you need to open multiple pages at once?