Solved

Open multiple pages with one hyperlink click

Posted on 2004-04-02
9
724 Views
Last Modified: 2012-08-13
how can we open multiple pages by one lick on hyperlink?
javascript or else?
and can we do it in frames?
0
Comment
Question by:LeDaouk
9 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 10743080
Link to a frameset document. Have the documents you want to load as the default pages for the frames (i.e. specify their urls in the src attributes of the <frame> tags).

Frames cause a lot of problems though - why do you think you need to open multiple pages at once?
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10743340
: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.open(url2);window.open(url3);window.open(url4);window.open(url5);return false;">Open Window :P</a>
</body>
</html>
0
 
LVL 4

Author Comment

by:LeDaouk
ID: 10744435
thanks jaysolomon
but could u tell me can can we load them each one in a frame the same time
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10744508
<a href="#" onclick="window.frames['frame1Name'].src = url1;window.frames['frame2Name'].src = url2;..................and so forth

I do not use frames so i cannot test this
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Author Comment

by:LeDaouk
ID: 10746702
I used the same code

<a href="#" onclick="window.open(url1);window.open(url2);window.open(url3);window.open(url4);window.open(url5);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?
0
 
LVL 5

Expert Comment

by:mokelly1
ID: 10747730
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. :^)
0
 
LVL 3

Expert Comment

by:azcn2503
ID: 10825830
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();">Open 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.
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 10846441
Closed, 25 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now