+ Reply to Thread
Results 1 to 8 of 8

Thread: Javascript: Opening 2 (or more) links with 1 Click

  1. #1
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    Javascript: Opening 2 (or more) links with 1 Click

    Introduction:-
    Here I will show you how to open one, two, three, four etc... links with one click!

    Let's Code:-
    Make this code between the HEAD tags:-

    Code:
    <script language="javascript">
    
    function OpenAllLinks() {
    window.open("http://www.site1.com")
    window.open("http://www.site2.com")
    window.open("http://www.site3.com")
    window.open("http://www.site4.com")
    window.open("http://www.site5.com")
    window.open("http://www.site6.com")
    }
    
    </script>
    and this into the BODY tags:-
    Code:
    <a href="javascript:OpenAllLinks()">Open the links</a>
    Explanation:-

    Code:
    function OpenAllLinks() {
    window.open("http://www.site1.com")
    window.open("http://www.site2.com")
    window.open("http://www.site3.com")
    window.open("http://www.site4.com")
    window.open("http://www.site5.com")
    window.open("http://www.site6.com")
    }
    Here you can include all your links!

    Conclusion:-
    Source code is attached, and feedback welcome
    Attached Files Attached Files
    Last edited by TcM; 01-06-2007 at 09:38 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jaan Guest
    lol great trick good job

  4. #3
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Thanks welcome

  5. #4
    xtraze is offline Programming God
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    911
    Rep Power
    0
    But are these opened as popups, as people (including myself) block them lol.
    And maybe a bug can be created by this. can make people without tabbed browsing mad., lol. Just a joke. Read again if you can't understand.

  6. #5
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Yes I understood! Something like Internet Explorer 6 rotfl, well but there may be more useful way of utilizing this

  7. #6
    xtraze is offline Programming God
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    911
    Rep Power
    0
    The thing I mentioned is complete useless, lol. It's just a joke to make the Browser or maybe the whole Computer Crash. Maybe this can be used when some one want 3-5 different files to be downloaded, if those files are available somwhere, we can have use of this script if we don't like to re-upload those files in our web server.

    I know this is not needed, but I think if we did find a need of this, we may come to codecall.

  8. #7
    AfTriX is offline Programming God
    Join Date
    Jan 2007
    Location
    Chicago
    Posts
    586
    Rep Power
    0
    Nice work with the Function, we can use to pop-up something when the user clicks download or something..

    Simply Cool..

  9. #8
    bbqroast's Avatar
    bbqroast is offline Programming God
    Join Date
    Jul 2010
    Posts
    506
    Blog Entries
    9
    Rep Power
    9

    Re: Javascript: Opening 2 (or more) links with 1 Click

    This would be good if one link was a file and the other to a thanks for downloading page (with links to tuts and other related stuff).
    Seeing as most browsers don't see files as popups this would be fine
    Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. JavaScript: Opening 2 links with 1 Click
    By TcM in forum JavaScript Tutorials
    Replies: 11
    Last Post: 12-19-2011, 11:18 PM
  2. [Javascript] Simple click indentation question
    By HumansAreFriendsNotFood in forum JavaScript and CSS
    Replies: 2
    Last Post: 09-24-2010, 10:46 PM
  3. Anyone Know How to Click A Button Using Javascript?
    By tradingjamie in forum JavaScript and CSS
    Replies: 1
    Last Post: 11-18-2009, 05:17 PM
  4. Adding bottom links with click-over feature? Help please!
    By Panarchy in forum JavaScript and CSS
    Replies: 98
    Last Post: 01-18-2009, 04:03 AM
  5. Do you click links in member signatures?
    By marwex89 in forum The Lounge
    Replies: 21
    Last Post: 10-01-2008, 09:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

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