[转]Jquery实现页面定时跳转

 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    2. <html xmlns="http://www.w3.org/1999/xhtml">  
    3. <html>    
    4.   <head>    
    5.   <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />  
    6.     <title>跳转页面</title>     
    7.     <mce:script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mce_src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></mce:script>      
    8.     <mce:script language="javascript"><!--  
    9.     
    10.         $(document).ready(function() {    
    11.             function jump(count) {    
    12.                 window.setTimeout(function(){    
    13.                     count--;    
    14.                     if(count > 0) {    
    15.                         $('#num').attr('innerHTML', count);    
    16.                         jump(count);    
    17.                     } else {    
    18.                         location.href="login.jsp";    
    19.                     }    
    20.                 }, 1000);    
    21.             }    
    22.             jump(3);    
    23.         });    
    24.       
    25. // --></mce:script>    
    26.   </head>        
    27.   <body>      
    28.     <span style="color:red" mce_style="color:red">欢迎来到******!</span><br/>页面将在3秒后跳转...<br/>还剩<span id="num">3</span>秒  
    29.   </body>    
    30. </html>  
原文地址:https://www.cnblogs.com/ZhuRenWang/p/4801384.html