Redirecting to two different urls?

Discussion in 'HTML & Website Design' started by Kriptonyc, Nov 30, 2010.

  1. #1
    Ohkay let's say I have code from google adsence that makes a banner ( or any other script like that maybe self made for my own website)

    Is it possible to make it so when that banner is clicked it redirects to two different places?

    Like I want to be able to click a link/banner and have it open up the website in that banner in the current window and then open up to a different link in another window.

    Is this possible!? Any ideas on how to make it happen?
     
    Kriptonyc, Nov 30, 2010 IP
  2. hosting211

    hosting211 Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you can. Like alot of sites have, when you click on something it opens a window to go to their place, but also open up the ads in the pop up. Let me see and find out.
     
    hosting211, Nov 30, 2010 IP
  3. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #3
    yes - you can create an event handler with javascript to do that...

    something like:
    
    <a href="http://LINK1.com" onClick="popIt();" title="banner or whatever" target="_blank">BANNER</a>
    
    Code (markup):
    I'm a bit tired so it's sloppy but the point was made that it can be done... I'm sure @CSM or @radiant_luv will pop in with a solution for you :)

    Cheers!~
     
    Last edited: Nov 30, 2010
    workingsmart, Nov 30, 2010 IP
  4. Kriptonyc

    Kriptonyc Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The example you provided would only redirect to one link though "link one" I need it to go to two places and I can't seem to find any example code on the interwebs!

    Anyone got some they'd be so kind to share?
     
    Kriptonyc, Nov 30, 2010 IP
  5. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #5
    No you are incorrect - the rough/sloppy and incomplete example I showed would be the trigger...

    LINK1 <== First link to open

    The event handler for popIt() would have the second link...
     
    workingsmart, Nov 30, 2010 IP
  6. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Hiya @WorkingSmart
    This should do OP?

    <a href="http://www.yahoo.com" onclick="window.open('http://www.google.com','newwin');">Click Here</a>
    Code (markup):
     
    Last edited: Dec 1, 2010
    radiant_luv, Dec 1, 2010 IP
  7. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #7
    Hey there @radiant_luv

    Add target="_blank" so that both events pop a new window :)
    
    <a href="http://www.yahoo.com" onclick="window.open('http://www.google.com','newwin');" target="_blank">Click Here</a>
    
    Code (markup):
     
    workingsmart, Dec 1, 2010 IP
  8. v3t0

    v3t0 Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #8
    thanks for the tips..gr8 tips
     
    v3t0, Dec 1, 2010 IP
  9. Kriptonyc

    Kriptonyc Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks so much been trying to do this fir a week haha!
     
    Kriptonyc, Dec 1, 2010 IP