Can I make two things happen with one click?

Discussion in 'HTML & Website Design' started by XooX, Nov 22, 2007.

  1. #1
    Now my requirement is this:

    There is a link on Page A. On clicking this link, 1) Page B needs to open in a new window and 2) Page A needs to refresh and show Page C.

    I can effect Page B opening just using the target="_new" attribute of <a>. But I am not sure how I can effect the (2) part. Any inputs shall be highly appreciated..
     
    XooX, Nov 22, 2007 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    <a href="c.html" onclick="window.open('b.html');">Click</a>
    Code (markup):
     
    joebert, Nov 22, 2007 IP
  3. XooX

    XooX Well-Known Member

    Messages:
    661
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Thanks for the code Joebert. Just one more query though. It shall not be considered a pop-up right? Sorry, I do not know much of coding.
     
    XooX, Nov 22, 2007 IP
  4. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #4
    That I can't help you with, I don't have much experience outside of websites that are on peoples popup blockers whitelists.
     
    joebert, Nov 23, 2007 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You could warn people that a new window should be expected when they click. That way, they can turn off their popup blockers before they click : ) People like being told what'll happen when they click. You can even make it a title which appears on hover "This link opens a new window and refreshes this page."
     
    Stomme poes, Nov 23, 2007 IP