Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-20-2011, 08:32 PM   PM User | #1
JTyler's Articl
New to the CF scene

 
Join Date: Dec 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
JTyler's Articl is an unknown quantity at this point
Google Adsense Rotate

I want to be able to rotate Adsense ads. 3/4 of the time, it will be someone else's. 1/4 of the time, it will be mine (my code is displayed already). However, the code I tried doesn't work. Can someone tell me how to fix this -

Code:
<script language="JavaScript">

images = new Array(4);

//the following string is really all on one line

images[0] = '<script type="text/javascript">google_ad_client = "ca-pub-4811954214954647";google_ad_slot = "2713945203";google_ad_width = 728;google_ad_height = 90;</script><script type="text/javascript"src="http:
//pagead2.googlesyndication.com/pagead/show_ads.js"
></script>';

 

images[1] = 'other code';

 

images[2] = 'other code';

 

images[3] = 'other code';

 

index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

</script>

Last edited by JTyler's Articl; 12-20-2011 at 08:55 PM..
JTyler's Articl is offline   Reply With Quote
Old 12-21-2011, 07:54 PM   PM User | #2
JTyler's Articl
New to the CF scene

 
Join Date: Dec 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
JTyler's Articl is an unknown quantity at this point
What do you mean?
JTyler's Articl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:43 AM.


Advertisement
Log in to turn off these ads.