$(function () {
var timer,
updateContent;
function resetTimer() {
if (timer) {
window.clearTimeout(timer);
}
timer = window.setTimeout(updateContent, 30000);
}
updateContent = function () {
resetTimer();
$.get('test.php', function (data) {
$('#content').html(data);
});
};
resetTimer();
$(document.body).on('mousemove keydown', resetTimer);
});
0 comments:
Post a Comment