Published on 2006-02-13 08:53:15

Stoyan have written an interesting script to Rotate Banners using AJAX. In the server side you can send your banners as images, flash, text or HTML, and the Javascript will simply do the rotation. what I found intersting is that Stoyan have joigned the rotation time with the banner itself so the display time could be different from an ad to another. The script is great to rotate ads on a single website, if you want more you'll common problem of AJAX Request from remote server.

So here's the case: rotate ads on a website, even when the page is not reloaded. If the chances are that the visitor will spend more time on a page, it makes sense to opt-in for displaying more than one ad at one page load. I've done this in the past using iframes, but hey, it's 21st century (the last time I checked) and we have AJAX! ;)

I also wanted to have the flexibility to display any ad type, which means I should be able to rotate pieces of HTML, rather than just images. Using HTML chunks, the ad can be an image, or formatted text, or swf, etc.


I want to point that Stoyan is running The Invisible Ad website, his AJAX vision of the Million Dollar Homepage where he sell pixels but this time invisible. You have to Move your mouse on the grid, and when you rest it on the full squares an advertisement is loaded.


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2010 phpmagazine.net All Rights Reserved