...

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



Bobafart
02-17-2008, 02: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?

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

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

should have thought of taht

you are truly a supreme coder

jlhaslip
02-17-2008, 09: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...

:P

_Aerospace_Eng_
02-17-2008, 10: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">
<html>
<head>
<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++)
{
window.open(links[i]);
}
return false;
}
</script>
</head>

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

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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum