使用javascript停止重新编写HTML页面 [英] Stop refeshing HTML Page using javascript
本文介绍了使用javascript停止重新编写HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何停止刷新页面,下面的代码是刷新页面
函数timedRefresh(timeoutPeriod){
setTimeout(location。 reload(true);,timeoutPeriod);
}
提前的Thanx
how to stop refreshing page, below code is for Refreshing page
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
Thanx in Advance
推荐答案
只是停止使用你刚刚创建的那个函数!
这个函数会告诉你的页面每个'timeoutPeriod'做刷新
just stop using that function you just made !
this function will telling your page every 'timeoutPeriod' do refresh
使用 - clearTimeout()方法 [ ^ ]。
Use - clearTimeout() Method[^].
var myVar;
function myFunction() {
myVar = setTimeout(function(){ alert("Hello"); }, 3000);
}
function myStopFunction() {
clearTimeout(myVar);
}
这篇关于使用javascript停止重新编写HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文