bradg
bradg

Reputation: 723

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 appreciated. Thanks

Upvotes: 0

Views: 2427

Answers (2)

zerkms
zerkms

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

KJYe.Name
KJYe.Name

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

Related Questions