curiouscat.comCurious Cat Code
curiouscat.com > code > JavaScript > Rotate Ads

This example shows how you can dynamically display an an ad based on the current minute. It can easily be modified to display an item by the day, data, hour or other Javascript variables. This code can be used on Wordpress, Blogger...

If minute (the minute in the current hour) is greater than 20 the Google AdSense ad appears. If minute is 20, or less, the Amazon Omakose ad is shown. Related code: rotate banners or images... using javascript. Of course, you need to insert the code from Google and Amazon to display your ads.


View a txt file with the JavaScript Dynamic Display code.

This code can be used to rotate between programs that do not allow each other to appear on the same page. Using Javascript to do this is not normally the best method but it will work in situation like a blogger blog where other options (server side code like ColdFusion or Ruby) are not available. Also using this code you can display more than one set of ads. Just repeat the code from where you want the ad to appear multiple times.

© 1996-2008   curiouscat.com      Feedback - Contact Us
Curious Cat web site by Curious Cat Creations. We can help create or improve your online presence.