页面定时刷新

一、使用js的setTimeout方法

var timer;
function startTimer(){clearTimeout(timer);timer=setTimeout(function(){location='default.aspx'},10*1000);}
document.onmousemove=document.onmousedown=startTimer

二、使用标签<meta>

<meta http-equiv="refresh" content="0; url=">

<meta http-equiv="refresh" content="0; url=">'经过一段时间转到另外某个页面
content="0;URL=",这里0表示没有延时,直接跳转到后面的URL;把0改成1,则延时1秒后跳转。
url不是必须的,当URL不存在时定时刷新当前页面 

猜你喜欢

转载自1069843121.iteye.com/blog/2411607