• 倒计时显示


    <script type="text/javascript">
       var timer = window.setInterval("Timer()",1000);//启用定时倒计
       var secs = 5;
       function Timer() {
          secs--;
          document.getElementById("btnShow").innerHTML = "倒计时:[" + secs + "]";
          if(secs == 0){
              window.clearInterval(timer);//清楚定时任务
              window.location.href="地址";
          }
        }
    </script>
    

      实例

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>X-Open</title>
    <link type="text/css" rel="stylesheet"
        href="static/css/bootstrap.min.css">
    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript" src="static/js/bootstrap.min.js"></script>
    </head>
    <body style="margin: 0px;">
        <%@ include file="/WEB-INF/jsps/header.jsp"%>
        <!-- 内容部分 -->
        <div class="container">
            <div class="row">
                <div class="col col-md-12" style="text-align: center;">你注册成功啦<br>
                现在可以去<a href="<c:url value='/login.html'/>">登陆啦</a>
                <br>
                <label id="lable"></label>
                </div>
            </div>
        </div>
    </body>
    <!-- 倒计时脚本 -->
    <script type="text/javascript">
       var timer = window.setInterval("Timer()",1000);//启用定时倒计
       var secs = 5;
       function Timer() {
          secs--;
          document.getElementById("lable").innerHTML = secs+"秒以后自动跳转到登陆页面";
          if(secs == 0){
              window.clearInterval(timer);//清除定时任务
              window.location.href="<c:url value='/login.html'/>";
          }
        }
    </script>
    </html>
  • 相关阅读:
    pyexharts教程
    elasticsearch常用查询语句
    kubelet连接apiserver报TLS错误
    k8s init.yaml
    bareapi nginx配置
    traefik配置https
    kubernetes中通过static pod部署elasticsearch生产集群
    聊天服务器架构
    使用JAX-RS的实现Jersey创建RESTful Web服务
    SpringBoot+Thymeleaf+MyBatis 实现RESTful API
  • 原文地址:https://www.cnblogs.com/fujilong/p/5353378.html
Copyright © 2020-2023  润新知