Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-17-2008, 02:17 PM   PM User | #1
Bobafart
Regular Coder

 
Join Date: Dec 2006
Posts: 416
Thanks: 168
Thanked 1 Time in 1 Post
Bobafart is on a distinguished road
How to chain a number of anchor links to open multi tabs?

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:

Code:
<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?
Bobafart is offline   Reply With Quote
Old 02-17-2008, 05:27 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Just use onclick="window.open('http://www.somesite.com');window.open('http://anothersite.com');etc..;return false;"
within the link.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Users who have thanked _Aerospace_Eng_ for this post:
Bobafart (02-17-2008)
Old 02-17-2008, 07:06 PM   PM User | #3
Bobafart
Regular Coder

 
Join Date: Dec 2006
Posts: 416
Thanks: 168
Thanked 1 Time in 1 Post
Bobafart is on a distinguished road
thank you will try it

should have thought of taht

you are truly a supreme coder
Bobafart is offline   Reply With Quote
Old 02-17-2008, 09:57 PM   PM User | #4
jlhaslip
Regular Coder

 
Join Date: Feb 2007
Location: Canada
Posts: 924
Thanks: 10
Thanked 56 Times in 55 Posts
jlhaslip is on a distinguished road
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

Last edited by jlhaslip; 02-17-2008 at 10:00 PM..
jlhaslip is offline   Reply With Quote
Old 02-17-2008, 10:06 PM   PM User | #5
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Here is the same thing that is easier to customize.
Code:
<!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>
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||

Last edited by _Aerospace_Eng_; 02-17-2008 at 10:50 PM..
_Aerospace_Eng_ is offline   Reply With Quote
Old 02-17-2008, 10:27 PM   PM User | #6
jlhaslip
Regular Coder

 
Join Date: Feb 2007
Location: Canada
Posts: 924
Thanks: 10
Thanked 56 Times in 55 Posts
jlhaslip is on a distinguished road
Can you place a Body Onload on that? :lol:
jlhaslip is offline   Reply With Quote
Old 02-17-2008, 10:50 PM   PM User | #7
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Quote:
Originally Posted by jlhaslip View Post
Can you place a Body Onload on that? :lol:
You could but most popup blockers would block something like this.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:50 PM.


Advertisement
Log in to turn off these ads.