日期:2014-05-16  浏览次数:20288 次

JavaScript实现定时页面跳转
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
var time = 8; //时间,秒

function Redirect(){
window.location = "http://www.baidu.com/";
}
var i = 0;
function dis(){
document.all.s.innerHTML = "还剩" + (time - i) + "秒";
i++;
}
timer=setInterval('dis()', 1000);//显示时间
timer=setTimeout('Redirect()',time * 1000); //跳转

//-->
</SCRIPT>
<BODY>
<span id="s"></span>
</BODY>
</HTML>
1 楼 shidongxu1030 2012-02-14  
很不错,刚刚试验过很好用。。。。