How reload div every 3 minutes
I have a div with id "myDiv" and i would like to update it every three minutes with content from a php file. Any help would be really app开发者_如何学运维reciated. Thanks
setInterval(function() {
$('#myDiv').load('/path/to/script.php');
}, 180000);
Note: the last argument is the number of milliseconds, that is why it is 3 minutes * 60 * 1000
you can use the setTimeOut() to communicate w/ php VIA AJAX and update the content of div id='myDiv' with the callback. setTimeOut method
精彩评论