开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜