javascript倒计时跳转代码

<script language='javascript' type='text/javascript'> 
var secs =6; //倒计时的秒数 
var URL ; 
function Load(url){ 
URL =url; 
for(var i=secs;i>=0;i--) 
{ 
window.setTimeout('doUpdate(' + i + ')', (secs-i) * 1000); 
} 
} 
function doUpdate(num) 
{ 
document.getElementById('ShowDiv').innerHTML = '将在'+num+'秒后自动跳转到 XXXXX; 
if(num == 0) { window.location=URL; } 
} 
</script> 

<div id="ShowDiv"></div> 
<script language="javascript"> 
Load("http://XXXXX"); 
</script> 
huan

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: