几秒钟后页面自动跳转到指定页

当页面出现错误时,有必要跳转到指定页面。对于seo优化和用户体验是不可缺少的。下面我指出两种跳转到指定页面的方法:

1.在head头部里写meta标签

<head>
        <meta http-equiv="refresh" content="0;URL=http://xxx.xxx.xxx/">
    </head>

content=0 ;   <!--设置本页面停留时间,单位为秒-->

url=http://www.baidu.com/    <!--将要跳转的页面路径-->

   2.用javascript实现
  <html>
      <script language=javascript>
          setTimeout('window.location="http://panliu888.myetang.com"',5000)
      </script>
  </html>
  location为指定跳转页面的路径,5000为时间,单位毫秒!

猜你喜欢

转载自blog.csdn.net/qq_32265203/article/details/81565894