View Full Version : How to chain a number of anchor links to open multi tabs?

02-17-2008, 03:17 PM
I am trying to develop a "lazy link" anchor where if the user clicks the link a number of predetermined links open up in separate tabs in Firefox and MIE 7+.

so basically:

<a href="more code here">click me to open 10 bookmarks</a>

users can click one link and it automatically opens up 10 of their favorite bookmarks

I realize this is potential for spam abuse -- but we already have popup blockers to prevent this -- I am lazy and I want to open my favorite sites with one link.. hence I think this is the best solution.

anyone know how to do this?

02-17-2008, 06:27 PM
Just use onclick="window.open('http://www.somesite.com');window.open('http://anothersite.com');etc..;return false;"
within the link.

02-17-2008, 08:06 PM
thank you will try it

should have thought of taht

you are truly a supreme coder

02-17-2008, 10:57 PM
Firefox's Bookmark Feature set already includes this capability. Just organize all those links into a Bookmark Folder and select "Open all in Tabs". Could likely make it your on-start page.

Oops! My Bad! I'll read the part about "on a web page" next time...


02-17-2008, 11:06 PM
Here is the same thing that is easier to customize.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
var links = new Array();
links[0] = 'http://www.codingforums.com';
links[1] = 'http://www.codingforums.com';
links[2] = 'http://www.codingforums.com';
links[3] = 'http://www.codingforums.com';
links[4] = 'http://www.codingforums.com';
links[5] = 'http://www.codingforums.com';
links[6] = 'http://www.codingforums.com';
links[7] = 'http://www.codingforums.com';
links[8] = 'http://www.codingforums.com';
links[9] = 'http://www.codingforums.com';
function openLinks()
for(var i = 0; i < links.length; i++)
return false;

<a href="#" onclick="return openLinks();">Open 10 Sites</a>

02-17-2008, 11:27 PM
Can you place a Body Onload on that? :lol:

02-17-2008, 11:50 PM
Can you place a Body Onload on that? :lol:

You could but most popup blockers would block something like this.