网页设定定时自动跳转

方式一: <meta http-equiv="refresh" content="5; url=http://www.baidu.com/" />

方式二:

<script type="text/javascript">
var wait = 3;
var time = document.getElementById("time");
function fun(){
wait--;
time.value = wait;
if(wait<=1){
location.href = "https://www.baidu.com/";
clearInterval(inter);
}
}
var inter = setInterval("fun()",1000);
</script>

但行好事,莫问前程。
原文地址:https://www.cnblogs.com/txhy/p/4901422.html