zoukankan      html  css  js  c++  java
  • html meta标签实现页面跳转

     refresh用于刷新与跳转(重定向)页面
     refresh出现在http-equiv属性中,使用content属性表示刷新或跳转的开始时间与跳转的网址

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="5;url=http://www.w3school.com.cn">
        <title>Title</title>
        <script type="text/javascript">
            window.onload = function () {
                var i = 4;
                var tim = document.getElementById("timers");
                var timer = setInterval(function () {
                    if (i == -1) {
    //                    window.location.href="http://blog.csdn.net/kill_bugs";
                        clearInterval(timer);
                    } else {
                        tim.innerHTML = i;
                        --i;
                    }
                }, 1000);
    
            }
        </script>
    </head>
    <body>
    <p>
        对不起。我们已经搬家了。您的 URL 是 <a href="http://www.w3school.com.cn">http://www.w3school.com.cn</a>
    </p>
    
    <p>您将在 <span class="timeShow" id="timers">5</span> 秒内被重定向到新的地址。</p>
    
    <p>如果超过 5 秒后您仍然看到本消息,请点击上面的链接。</p>
    </body>
    </html>
    

      

  • 相关阅读:
    [2020多校联考]甲虫
    .eww
    MinGW安装c-c++
    .竖梁上的两个孔最小距离可以是多少呢?PS15D
    .dwg(sw)-exb
    开始学emacs-1
    看jpg和png图片
    .系列化参数关系
    2015计划
    大蚂蚁在64位系统下,右键没有快发的解决方案
  • 原文地址:https://www.cnblogs.com/ycg-myblog/p/10280572.html
Copyright © 2011-2022 走看看