Can I put AdSense ads in a random JavaScript file?

Discussion in 'AdSense' started by powwka, Nov 15, 2006.

  1. #1
    I know some sites (DP for example) have random ads displayed (different colors with each refresh). I'm assuming this is done with a JS file, and an array. At least that is how I display my Commission Junction ads. I have a JS file called ads.js and there is a function that displays random ads. So wherever I want an ad, I just call that function.
    So question #1 - Is this ok to do with AdSense?

    Question #2 - How exactly would I do this?
    With the CJ ads, I just use the HTML. But AdSense ads are is JavaScript so that makes it harder. Do I do something like -

    EDIT: Nevermind the code I had. I've been trying stuff out and I can't get the ads to show up. Any ideas?
     
    powwka, Nov 15, 2006 IP
  2. Notorious

    Notorious Well-Known Member

    Messages:
    903
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    145
    #2
    like this :-

    google_color_border = ["FFFF88","FF8888","8888FF","88FF88","CC0000","CC0000"];
    google_color_bg = ["FFFFCC","FFCCCC","CCCCFF","CCFFCC","FFFFFF","FFFFCC"];
    google_color_link = ["000066","000066","000066","000066","0000FF","000000"];
    google_color_text = ["222222","222222","222222","222222","006600","000000"];
    google_color_url = ["222222","222222","222222","222222","000000","000800"];
     
    Notorious, Nov 15, 2006 IP
  3. samzach

    samzach Peon

    Messages:
    484
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    how come DP is only getting the directory contest ad on the top?!
     
    samzach, Nov 15, 2006 IP
  4. powwka

    powwka Peon

    Messages:
    583
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's not...
     
    powwka, Nov 15, 2006 IP