Reputation: 723
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 appreciated. Thanks
Upvotes: 0
Views: 2427
Reputation: 255115
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
Upvotes: 7
Reputation: 17169
you can use the setTimeOut() to communicate w/ php VIA AJAX and update the content of div id='myDiv' with the callback. setTimeOut method
Upvotes: 0