View Full Version : Open multiple window at once

11-11-2008, 04:33 PM
Hi all, I would like to make a link on my page to open multiple window at once. For example, clicking on the link "Click here" will open 3 new windows at once, each pointing to a different page. I know it is possible to do this with javascript window.open but the page I wanted to open will be dynamic.

In another word, I want a link to open up multiple pages in my rss feed. So the link is not the same each time. May I know how to do this? I would appreciate if you can show me the code =) Thanks in advance

11-12-2008, 04:37 AM
How are the links being placed? You could contain them in one container and loop through all the links, and assign an onclick event on each of them:

<script type="text/javascript">
var ray={
* links array accepts three params
@ param1 - URL you wish to open
@ param2 - name of the window
@ param3 - window preferences
['http://www.dynamicdrive.com','window3','left=500,width=300,height=300'] // No comma
], // Links you wish to open together with the window name and the preferences
var lnkArr=this.getID(el).getElementsByTagName('a');
for(var i=0;i<lnkArr.length;i++)
for(var c=0;c<ray.links.length;c++)
return document.getElementById(el);
ray.loop('contain'); // Pass the ID of the container here
<div id="contain">
<a href="#">Top Anchor</a><br>
<a href="http://www.google.com">http://www.google.com</a><br>
<a href="http://www.yahoo.com">http://www.yahoo.com</a><br>

Hope that helps.

11-12-2008, 04:58 AM
Thanks. I am aware of that code but the function I am after is not exactly that. I want to open up multiple windows from my rss feed. So I will not know the url for the webpage in advance.

For example: http://news.google.com/?ned=us&topic=t&output=rss

If I wanted to open the latest 3 posts from Google news feed. Is there a way to dynamically assign the feed title and use javascript to open them?