Javascript函数每X秒重新载入一个页面? [英] Javascript function to reload a page every X seconds?
本文介绍了Javascript函数每X秒重新载入一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有几个问题:
-
我从来没有真正使用过除
其次,该页面包含最低限度的字面意思,仅仅是一个输入框。我是否还需要包含html之外的JS侦听器onclick 和
onkey
事件,所以我想知道是否有人可以帮我提供我需要的内容以便每X秒重新加载一次页面?头
和body
?
解决方案
这个简单的函数不需要Javascript。添加页面标题:
< meta http-equiv =Refreshcontent =300>
300是本例中的秒数。
A couple of questions:
I've never really used JS listeners other than
onclick
andonkey
events, so I wondered if someone could help me with what I need in order to reload the page every X seconds?Secondly, the page contains bare minimum, literally just one input box. Do I still need to include the html
head
andbody
?
解决方案
You don't need Javascript for this simple function. Add in the page header:
<meta http-equiv="Refresh" content="300">
300 is the number of seconds in this example.
这篇关于Javascript函数每X秒重新载入一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文