SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Aug 1999
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi everyone...

    I was wondering if anyone could help me with the javascript code that inserts a random number into the banner code. I had an example a month ago that worked, I stopped using it for a while, and now the forum I had gotten it from has deleted that post. I've tried to take other examples and make my own, but the banner doesn't display correctly. I'm not sure what I'm doing!

    RANDOM is where I need the number inserted:

    <A HREF="http://ad.doubleclick.net/jump/blahblah;ord=RANDOM" target="_top">
    <IMG SRC="http://ad.doubleclick.net/ad/blahblah;ord=RANDOM" HEIGHT=60 WIDTH=468 BORDER=0></A>

    Thanks in advance if you can help

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the exact place you will find your answer:

    http://www.sonar.com/tag/tag_info/#rm

    You could also use their tag-generator
    Hope that helps
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Zealot
    Join Date
    Aug 1999
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, but that page indicates that I either need a script to insert the random number, or that I need to manually insert the random number.

    I need to rotate this ad between others, so the manual option is out. I am interested in javascript to insert the random number because I know it works and have used it before.

    (As for using their tag generator, I'm not a member of the sonar network, just showing ads for an agency that uses doubleclick.)


  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So here is a banner code that has JavaScript to generate random number. Btw, you could get examples of this technic all over the place, just try to view the source code of a page that has some ads, you might be able to find a good one. I believe Flycast and FastClick utilize this method too.
    Change to match your need.

    ------------

    <script language="JavaScript"><!--
    random = parseInt(Math.random()*1000)
    banner = '<A HREF="http://www.guideclick.com/cgi-bin/banner/zone_46860.pl?banner=NonSSI;'
    banner += 'page=' + random + '" TARGET="_blank">';
    banner += '<IMG SRC="http://www.guideclick.com/cgi-bin/banner/zone_46860.pl?'
    banner += 'page=' + random + '" WIDTH=468 HEIGHT=60'
    banner += ' ALT="Click Here!" BORDER=0></A>'
    document.write(banner)
    // -->
    </script>
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    SitePoint Zealot
    Join Date
    Aug 1999
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help. I had tried using other examples, and must have made some minor errors because I never could get it to work properly. Posting to the forum is always my last resort.

    I didn't have any problems with your example. Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •