PeriodicalUpdater plugin for jQuery

What's going on here?

PeriodicalUpdater is a plugin for jQuery that emulates Prototype's Ajax.PeriodicalUpdater function.

The general idea is that ajax requests are sent at specified intervals, and if the data from the server doesn't change, the requests get less and less frequent. If the data from the server changes, the interval for requests is reset.

What's going on in this example?

We're calling a PHP script that will return '1' 80% of the time, and '2' 20% of the time. When the results don't change, the time between requests gets longer and longer. When the results do change, the div below is updated and the interval goes back to the minimum value. This is all configurable via the arguments passed.

If you're using Firefox and Firebug, you can watch the ajax requests being sent out.

Back to documentation

Results from $.PeriodicalUpdater()

Stop ajax requests!