`
caozuiba
  • 浏览: 902995 次
文章分类
社区版块
存档分类
最新评论

js定时页面跳转

 
阅读更多
<script type="javascript">
<!--
var duration=2900;
var endTime = new Date().getTime() + duration + 100;
function interval()
{
var n=(endTime-new Date().getTime())/1000;
if(n<0) return;
document.getElementById("timeout").innerHTML = n.toFixed(3);
setTimeout(interval, 10);
}
window.onload=function()
{
setTimeout("window.location.href='index.asp'", duration);
interval();
}
//-->
</script>
<html>
<head>
<title>齐飞</title>
</head>
<body>
<form id="form">
<div>
恭喜您已注册成功!<br />
系统在 <span id="timeout">3.000</span> 秒后 将自动跳转到 <a href="index.asp">社区首页</a>
</div>
</form>
</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics