js延時自動跳轉到指定頁面的跳轉代碼
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "HTTP://www.w3.org/tr/xhtml1/dtd/ xhtml1-transitional.dtd">
<html xmlns="HTTP://jzread.com/1999/xhtml">
<head>
<meta HTTP-equiv="content-type" content="text/html; charset=gb2312" />
<title>js延時自動跳轉到指定頁面的跳轉代碼</title>
<script language=javascript教程>
function gou(secs,surl){
if(--secs>0){
settimeout("gou("+secs+",'"+surl+"')",1000);
}
else{
location.href=surl;
}
}
gou(5,'HTTP://www.jzread.com');
</script> 方法二
5是指停留5秒鐘後自動刷新到url網址
<meta HTTP-equiv="refresh" content="5; url=HTTP://www.jzread.com">
方法三
<script type="text/javascript教程">
<!--
function go(t,url){
t設置跳轉時間:秒
url設置跳轉網址
document.write("<div id=text>本頁將在<strong id=tt></strong>後,跳轉至:<span id=link></span ></div>");
document.getelementbyid("link").innerhtml="<a href="+url+">"+url +"</a>";
$(t,url);
}
function $(t,url){
ta = t-1;
tb = t+"000";
d = docume nt.getelementbyid("tt");
d.innerhtml=t;
window.setinterval(function()
{
go_to(url);
},1000);
}
function go_to(url){
d.innerhtml=ta--;
if(ta<0){
document.write("正在跳轉至:<a href="+url+">"+url+"</a>");
location.href=url;
}
else{
return;
}
}
-->
</script>
<script type="text/javascript">
go(5,"HTTP://www.jzread.com")
</script>
方法三
<script language="javascript">
location.replace("HTTP://www.jzread.com/")
</script>
</head>
<body>
</body>
</html>