<!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>页面定时跳转(收集整理)
最新推荐文章于 2026-06-15 11:35:15 发布
4万+

被折叠的 条评论
为什么被折叠?



