1. 程式人生 > >幾秒鐘後頁面自動跳轉到指定頁

幾秒鐘後頁面自動跳轉到指定頁

當頁面出現錯誤時,有必要跳轉到指定頁面。對於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為時間,單位毫秒!