Timed Ajax

An easy example that shows how to make a timed Ajax request. Useful if you want to update some part of your site every X time (where X should be a reasonable amount), dangerous and pointless if you abuse of it.

Timed Ajax

Pressing start button the demo will start requesting ajax_timed.php every 4s. Technique used allow to prevent browsers from caching php, adding a dummy query formed by $time() and a random number from 0 to 100. So the request ajax will be something like:

ajax_timed.php?1192651244265

Where 1192651244265 will change at every request. However, there are several ways to prevent caching.

See ajax_timed.phps

Ajax Response