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

js3秒自动跳转
<html>
 <head>
  <title> New Document </title>
<script language="javascript">   
function init(){
window.setInterval("settime()",1000);   
window.setInterval("skipUrl()",3000);   
}  
function settime(){   
var divinner=document.getElementById("divinner");
if(divinner.innerText>1){
divinner.innerText = divinner.innerText-1;   
}
}
function skipUrl(){
var f_url='http://www.baidu.com';
window.location.replace(f_url);  
}   
</script>  
 </head>
 <body onload="init();">
  <div id="divinner">3</div>
 </body>
</html>