how to make my php page reload each 2 minutes using javascript?

后端 未结 6 1947
南旧
南旧 2021-02-06 18:47

Every two minutes i want to check whether i received some message so want to reload my page every 2 minutes how to reload my php page using javascript

6条回答
  •  无人共我
    2021-02-06 19:08

    Quick and dirty:

    setTimeout( function() {
        location.reload()
    }, 120000);
    

    Though I think there could possibly be a fancier way of doing this, this is just what I know though.

提交回复
热议问题