1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Opening multiple windows on one click

Discussion in 'HTML & JavaScript' started by PhiltheBear, Dec 5, 2010.

  1. PhiltheBear

    PhiltheBear Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2008
    Messages:
    197
    Likes Received:
    93
    This is probably simple but I can't see a way of doing it in HTML so maybe Java...

    I want a user to click a banner on a webpage. When it's clicked I want to open a new window behind the current window. I also want to change the banner to another one e.g from a graphic that says 'Click Here' to one that says 'Thanks for clicking'.

    If it's easier I'm prepared to load a new, duplicate page which simply has a new graphic in the same place.

    Can anyone help?

    Thanks
     
  2. PhiltheBear

    PhiltheBear Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2008
    Messages:
    197
    Likes Received:
    93
    Duplicate - ignore
     
    Last edited: Dec 5, 2010
  3. contentfreak

    contentfreak Registered Member

    Joined:
    Jun 13, 2010
    Messages:
    82
    Likes Received:
    19
    urlopener.com
     
  4. PhiltheBear

    PhiltheBear Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2008
    Messages:
    197
    Likes Received:
    93
    Duplicate - ignore
     
    Last edited: Dec 5, 2010
  5. contentfreak

    contentfreak Registered Member

    Joined:
    Jun 13, 2010
    Messages:
    82
    Likes Received:
    19
    urlopener*com
     
  6. PhiltheBear

    PhiltheBear Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2008
    Messages:
    197
    Likes Received:
    93
    That opens multiple windows - but doesn't replace the original.
     
  7. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,387
    Gender:
    Male
    Occupation:
    Artist / Craftsman
    Location:
    sitting at my PC
    This thread is from last month so OP may not need to know anymore, but might as well answer it for anyone else looking at the thread.

    This will open whatever is in the href=" " in the current window,
    each new window will then open in order, last one will become the new active window.
    Code:
    <html>
    <head>
    <title>Open multiple windows when link is clicked</title>
    </head>
    <body>
    
    <p><a href="http://domain1" onclick="window.open('http://domain2.com'); 
                    window.open('http://domain3.com');">Click Here</a>
     Go to domain1, open domain2 and domain3 in new windows</p>
    
    <p><a href="#" onclick="window.open('http://domain1.com'); 
                    window.open('http://domain2.com');">Click Here</a>
     Leave page open, open domain1 and domain2 in new windows</p>
    
    </body>
    </html>
    (If you wanted the current page to remain the active page then put the href="domain1" and then window.open("#") in the last position. That'll break the "Back" button though. The current page would reopen in a new window, and the history would stay with domain1 in the old window.)

    Popup blockers may or may not catch this. Mine didn't catch it though. :cool2:
     
    • Thanks Thanks x 3
    Last edited: Jan 30, 2011
  8. PhiltheBear

    PhiltheBear Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2008
    Messages:
    197
    Likes Received:
    93
    Thanks GreyWolf - I'll give that a try.
     
  9. morgan456

    morgan456 Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 26, 2010
    Messages:
    2,112
    Likes Received:
    247
    Gender:
    Male
    Occupation:
    SEO company
    you can open muliple windows through Batch programming as well i think you know that already
     
  10. ludwig221

    ludwig221 Newbie

    Joined:
    Sep 20, 2009
    Messages:
    11
    Likes Received:
    0
    Basically the same as what greywolf said...

    <html>
    <a href="/************/69qgq6f/" target="_blank" onclick="window.open("************/69qgq6f/"); window.open("************/69qgq6f/");window.open("/69qgq6f/");window.open("************/69qgq6f/");window.open("************/6fcveqw/");window.open("************/6fcveqw/");window.open("************/6fcveqw/");window.open("************/6fcveqw/");
    window.open("************/6fcveqw/");">This link opens several CITYVILLE ENERGY and PERMIT tabs in one click</a>
    </html>

    this is ctyville urls i used to open, but change it with ur own
     
  11. williamjen12

    williamjen12 Newbie

    Joined:
    May 9, 2011
    Messages:
    1
    Likes Received:
    0
    Press conrtol and click on particular link so you can open that page in new window. If you want to open multiple window at a time you should give a link on particular syntax.