You need a script on the server that set the timestamp to check if new records were inserted into the database after this timestamp. If so, the script should return a response with the new information.
AJAX script, normal , timestamp .
AJAX , . AJAX timestamp.
- jQuery:
var lastUpdate = '';
function autoUpdate() {
$.ajax({
type: "GET",
url: "check_updates.aspx?last_update=" + lastUpdate,
dataType: 'json',
success: function(jsonData) {
setTimeout(autoUpdate, 5000);
}
});
}