Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    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?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    Bobafart (02-17-2008)

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    thank you will try it

    should have thought of taht

    you are truly a supreme coder

  • #4
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    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 11:00 PM.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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>
    Last edited by _Aerospace_Eng_; 02-17-2008 at 11:50 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    Can you place a Body Onload on that? :lol:

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •