目錄結構:
contents structure [-]
html實現了元的倒數
下面列了五個例子來詳細說明,這幾個例子的主要功能是:在5秒後,自動跳到同目錄下的hello.html(依自己需要自行修改)檔案。
1) html的實作<head>
<!-- 以下方式只是刷新不跳转到其他页面 -->
<meta http-equiv="refresh" content="10">
<!-- 以下方式定时转到其他页面 -->
<meta http-equiv="refresh" content="5;url=hello.html">
</head>
<script language="javascript" type="text/javascript">
// 以下方式直接跳转window.location.href='hello.html';// 以下方式定时跳转setTimeout("javascript:location.href='hello.html'", 5000);
</script>
3) 結合了倒數的javascript實現(IE)
化
缺點:firefox不支援(firefox不支援span、p等的innerText屬性)
3') 結合了倒數的javascriptr🜎 ) 解決Firefox不支援innerText的問題
<span id="totalSecond">5</span> <script language="javascript" type="text/javascript"> second ="redirect()", 1000=--(second<0) location.href='hello.html'</script>
5) 結合了倒數的javascript實作(IE,Fiox)
更多【HTML】Html頁面跳轉的5種方式相關文章請關注PHP中文網!