如何每5秒重新加载页面? [英] How to reload page every 5 second?
本文介绍了如何每5秒重新加载页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将一个布局转换为html;一旦我在代码/ html / css中进行了更改,每次我必须按F5。有没有简单的javascript / jQuery解决方案?即添加脚本后,每5秒(或其他特定时间)重新加载整个页面。
I am converting one layout to html; once I make the changes in code/html/css, every time I have to hit F5. Is there any simple javascript/jQuery solution for this? I.e. after I add the script, reload the whole page every 5 seconds (or some other specific time).
推荐答案
<meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html">
如果必须在脚本中,请使用 setTimeout like:
If it has to be in the script use setTimeout like:
setTimeout(function(){
window.location.reload(1);
}, 5000);
这篇关于如何每5秒重新加载页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文