<input tpye=checkbox id=aa onclick="gua()">
<script>
function gua()
{var timer=null;
if(aa.checked)
timer=settimeout("window.location.reload()",5000);//每隔5秒
else
if(timer!=null)
clearTimeout(timer);
}
</script>
<script>
function gua()
{var timer=null;
if(aa.checked)
timer=settimeout("window.location.reload()",5000);//每隔5秒
else
if(timer!=null)
clearTimeout(timer);
}
</script>
<script>
function ref()
{
if(rfc.checked==true)
{timecount=setTimeout("window.location.reload()",5000);}
else
{clearTimeout(timecount);}
}
</script>zhangguagua(瓜瓜) 的代码中,setTimeout()大小写搞错了。
<script>
if(document.location.search)
{
document.getElementById("chkRefresh").checked=true;
refreshinterval=setInterval("location.href='2.htm?refresh=true'",2000);
}
function setrefresh()
{
if(document.getElementById("chkRefresh").checked==true)
{refreshinterval=setInterval("location.href='2.htm?refresh=true'",2000);}
else
{clearInterval(refreshinterval);}
}
</script>