need help with openin a new window with javascript

Discussion in 'JavaScript' started by theynd, Feb 28, 2006.

  1. #1
    well here's the code


    <*script type="text/javascript" src="http://4.adbrite.com/mb/text_group.php?sid=73248&amp;col=2&amp;br=1&amp;dk=7469636b6574735f355f32"></script>

    from adbrite, how would i make it so that when a user click on it, it would open a new window? thanks alot
     
    theynd, Feb 28, 2006 IP
  2. brunozugay

    brunozugay Peon

    Messages:
    150
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Am I right to assume the script spits out a link, that once clicked opens in the same window? If so, the only way to have it open in another window, is to change anchor attributes through DOM.

    Here’s an example:
    http://www.w3schools.com/js/tryit.asp?filename=try_dom_anchor_href

    I hope this helps.
     
    brunozugay, Feb 28, 2006 IP
  3. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    theynd, what you posted is a javascript src reference to AdBrite's code, and it's in their source that the the ad and link(s) are generated. There are hacks that allow you to open ad links in new windows, but most ad networks forbid it.

    If you look at AdBrite's terms and conditions, it says:
     
    torunforever, Feb 28, 2006 IP
  4. theynd

    theynd Banned

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks alot
     
    theynd, Feb 28, 2006 IP