//30s后跳转到目标页面
无url则为每30s刷新自身
<head>
<meta http-equiv="refresh" content="30,url=/''>
</head>
//定时器,倒计时-----
var int = 2
function countdown() {
document.getElementById("code").innerHTML = int + "秒后页面跳转";
int--;
if(int<0){
i=window.clearInterval(i)//结束
int = 2; //重新赋值
}
}
countdown();
setInterval(countdown,1000);
网友评论