• js实现指定时间跳转到另一个页面


     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <title>setTimeout</title>
     5 </head>
     6 <body>
     7 <h1>跳转页面</h1>
     8 <form>
     9     <div>
    10         <p><span id="skip"></span>秒后跳转到主页面</p>
    11     </div>
    12 </form>
    13 <script type="text/javascript">
    14     var t = 5;
    15     function showTime() {
    16         t -= 1;
    17         document.getElementById('skip').innerHTML = t;
    18         if (t == 0) {
    19             window.location.href = 'http://www.baidu.com';
    20         }
    21         setTimeout("showTime()",1000);
    22     }
    23     showTime();
    24 </script>
    25 </body>
    26 </html>
    js实现简单跳转
  • 相关阅读:
    格式化输出数字
    传教士经验
    集合
    替换
    连接
    填充
    取值
    分割
    创建日历和日期列表
    常用日期格式
  • 原文地址:https://www.cnblogs.com/sxh-myblogs/p/8214204.html
Copyright © 2020-2023  润新知