/    Sign up×
Community /Pin to ProfileBookmark

banners Ads open New Page??

can someone tell me how to add to this script to get the banner ads to open in a new window?

[QUOTE]

<!– ONE STEP TO INSTALL BANNER ADS:

  • 1. Add the first code to the BODY of your HTML document –>
  • <!– STEP ONE: Add the first code to the BODY of your HTML document –>

    <BODY>

    <SCRIPT LANGUAGE=”JavaScript”>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– Begin
    var how_many_ads = 3;
    var now = new Date()
    var sec = now.getSeconds()
    var ad = sec % how_many_ads;
    ad +=1;
    if (ad==1) {
    txt=”The World’s Largest Online Bookstore, Amazon.com”;
    url=”http://www.amazon.com“;
    alt=”amazon.com”;
    banner=”http://imageserv.imgis.com/images/Ad12669St1Sz1Sq1_Ban1.gif“;
    width=”468″;
    height=”60″;
    }
    if (ad==2) {
    txt=”Palm III by 3Com, in stock!”;
    url=”http://cybershop.com/“;
    alt=”cybershop.com”;
    banner=”http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif“;
    width=”468″;
    height=”60″;
    }
    if (ad==3) {
    txt=”Find it at GoTo.com”;
    url=”http://www.goto.com“;
    alt=”goto.com”;
    banner=”http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif“;
    width=”468″;
    height=”60″;
    }
    document.write(‘<center>’);
    document.write(‘<a href=”‘ + url + ‘” target=”_top”>’);
    document.write(‘<img src=”‘ + banner + ‘” width=’)
    document.write(width + ‘ height=’ + height + ‘ ‘);
    document.write(‘alt=”‘ + alt + ‘” border=0><br>’);
    document.write(‘<small>’ + txt + ‘</small></a>’);
    document.write(‘</center>’);
    // End –>
    </SCRIPT>

    <p><center>
    <font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
    by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
    </center><p>

    <!– Script Size: 1.44 KB –>

    [/QUOTE]

    to post a comment
    JavaScript

    7 Comments(s)

    Copy linkTweet thisAlerts:
    @requestcodeOct 09.2003 — Change this line:

    document.write('<a href="' + url + '" target="_top">');

    To this:

    document.write('<a href="' + url + '" target="_new">');
    Copy linkTweet thisAlerts:
    @gavron1authorOct 09.2003 — Perfect.... Thank you very much!
    Copy linkTweet thisAlerts:
    @pyroOct 09.2003 — _new? I think that should be _blank. http://www.w3.org/TR/REC-html40/types.html#h-6.16
    Copy linkTweet thisAlerts:
    @requestcodeOct 09.2003 — I have used both _new and _blank and they both work the same. I have used them in different browsers with no problems.
    Copy linkTweet thisAlerts:
    @pyroOct 09.2003 — Generally, any target that the browser does not find (if used with frames)/understand will result in a new window. But, as far as I know, there is nothing that says they have to, so I'd use the correct version, which is target="_blank" (In transitional and frameset -- in strict, the target attribute has been depreciated).
    Copy linkTweet thisAlerts:
    @requestcodeOct 09.2003 — Yep - your right. I did some test and found that I could name it anything and it would work. Not sure where I got the "_new" from. I have been using if for quite a while now. Must have tried it once and since it worked assumed it was alright. Thanks for the info. ?
    Copy linkTweet thisAlerts:
    @pyroOct 09.2003 — hehe... no problem... ?
    ×

    Success!

    Help @gavron1 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...