<!doctype html
<head>
<meta charset=utf-8" />
<title>js定时跳转页面的方法</title>
</head>
<body>
<script>
var t=10;//设定跳转的时间
setInterval("refer()",1000); //启动1秒定时
function refer(){
if(t==0){
location="http://www.baidu.com"; //#设定跳转的链接地址
}
document.getElementById('show').innerHTML=""+t+"秒后跳转到百度"; // 显示倒计时
t--; // 计数器递减
}
</script>
<span id="show"></span>
</body>
页面定时跳转(收集整理)
最新推荐文章于 2024-09-29 15:49:41 发布