1 <div> 2 <script src="http://www.qq.com/404/search_children.js" type="text/javascript" charset="utf-8"></script> 3 </div> 4 5 <script language="javascript"> 6 var oTime=document.getElementById('time'); 7 var oSecs=5; 8 function time() 9 { 10 oSecs --; 11 if (oSecs < 0) 12 { 13 clearInterval(); 14 return; 15 } 16 17 if (oSecs == 0) 18 { 19 clearInterval(); 20 window.location.href = 'http://www.baidu.com';//换成自己的首页 21 } 22 oTime.innerHTML = oSecs; 23 } 24 setInterval(time,1000) 25 </script>