random js ads?

Discussion in 'HTML & Website Design' started by surfer33, Jul 24, 2007.

  1. #1
    i have some ads codes
    4 example adbrite YPN adsense clicksor

    and this is a js file:
    document.write('adbrite');
    document.write('YPN');
    document.write('ADSENSE');
    document.write('clicksor');

    but how i can show them randomly?(i want show a ad in my site randomly - for example for first visit my blog show adbrite ads and for second visitor show clicksor ad...)

    how i can do it?
     
    surfer33, Jul 24, 2007 IP
  2. kampoo

    kampoo Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What is your site scripts (server side such php, asp or html only)
     
    kampoo, Jul 24, 2007 IP
  3. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you're using JS, Math.random() works. If PHP, rand() will work. Just use an if or case statement to check the value and display the ad accordingly.
     
    Gordaen, Jul 24, 2007 IP
  4. surfer33

    surfer33 Banned

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i have a blog on the blogspot
    i puted my js file on the google pages ...
    (pages.google.com)
     
    surfer33, Jul 24, 2007 IP
  5. surfer33

    surfer33 Banned

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    plz give me a full js file(an exam)
     
    surfer33, Jul 24, 2007 IP