Home  >  Article  >  Web Front-end  >  JS 跳转页面延迟2种方法_javascript技巧

JS 跳转页面延迟2种方法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:39:001883browse

方法1:

复制代码 代码如下:

");
document.getElementById("link").innerHTML=""+url+"";
$(t,url);
}
function $(t,url){
ta = t-1;
tb = t + "000";
d = document.getElementById("tt");
d.innerHTML=t;
window.setInterval(function()
{
go_to(url);
},1000);
}
function go_to(url){
d.innerHTML=ta--;
if(tadocument.write("正在跳转至:"+url+"");
location.href=url;
}
else{
return;
}
}
//-->



方法2:
复制代码 代码如下:

window.setTimeout("window.location='index.shtml'",2000);
//两秒后跳转新页面
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn