几秒钟后自动跳转

来源:互联网 发布:淘宝win10激活码危险 编辑:程序博客网 时间:2024/04/30 04:05
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>LoginFail page !!</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
  </head>
 
  <body>
  <table>
      <tr><td><h2><s:property value="loginError"/></h2></td></tr>
      <tr><td><h2 id="time">6</h2><h3>秒钟后自动跳转到&nbsp;<a href="admin/Admin-loginInput.jsp">登录页面</a></h3></td></tr>
      <tr><td><h3>正在为您跳转 . . .</h3></td></tr>
  </table>
    <script type="text/javascript">
        function toNextPage(url){
            var currenttime=document.getElementById("time").innerHTML;    
            if(currenttime>0){
                currenttime--;
                document.getElementById("time").innerHTML=currenttime;
                }else{
                window.top.location.href=url;
                    }
                setTimeout("toNextPage('"+url+"')",1000);            
            }
    </script>
    <script type="text/javascript">
        toNextPage("admin/Admin-loginInput.jsp");
    </script>
  </body>
</html>
原创粉丝点击