Back to johnmccollum.co.uk

This piece of javascript is an imitation of Prototype's Ajax.PeriodicalUpdater, for jQuery.

It repeatedly updates the div below via ajax, but if the content doesn't change, the length of time between updates increases. Check out the source code to see how it works!

The php script has an 80% chance of outputting '1' and a 20% chance of outputting '2'. Each time the outputted value differs from the last, the timer will reset to calls every second.

Number of requests sent: 0