• 倒计时跳转


    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>注册失败</title>
    </head>
    <body>
    	<p style="color:red;">注册失败,用户名以存在!</p>
    	<p><strong><span id="sendRedirect">5</span><span>秒后返回首页</span></strong>,如想重新注册请点击<a href="register.jsp">注册</a></p>
      <script type="text/javascript">  
        var num=document.getElementById('sendRedirect').innerHTML;
    	//获取显示秒数的元素,通过定时器来更改秒数。
    	function te(){		
    		document.getElementById('sendRedirect').innerHTML=num; 
    			num--;
    			if(num==0){
    				location.assign("index.jsp");
    				//通过window的location和history对象来控制网页的跳转。
    			}
    	}
    	setInterval("te()",1000);    
     </script> 
    </body>
    </html>
    
  • 相关阅读:
    小涛涛的计算器
    Sort排序浅聊
    程序员PC选购
    冒泡排序
    Django之模板
    Django中model的Meta选项
    Django之路由系统
    Django之视图系统
    踏上Flask的不归路(二)
    踏上Flask的不归路(一)
  • 原文地址:https://www.cnblogs.com/caoleiCoding/p/9124961.html
Copyright © 2020-2023  润新知