javascript
N秒钟后自动跳转的html页面,javascript
最簡單的設置一下apache的首頁自動跳轉,簡單起見,直接編輯/var/www/html/index.html,填入一下內容,不用來回設置httpd.conf了就。
This page will take you to the Trac Home Page
3
seconds later
If you don’t want to wait, Click Here
<mce:script language=“javascript” type=“text/javascript”><!–
var second = document.getElementById(‘totalSecond’).textContent;
if (navigator.appName.indexOf(“Explorer”) > -1) {
second = document.getElementById(‘totalSecond’).innerText;
} else {
second = document.getElementById(‘totalSecond’).textContent;
}
setInterval(“redirect()”, 1000);
function redirect() {
if (second < 0) {
location.href = ‘trac/’;
} else {
if (navigator.appName.indexOf(“Explorer”) > -1) {
document.getElementById(‘totalSecond’).innerText = second–;
} else {
document.getElementById(‘totalSecond’).textContent = second–;
}
}
}
// --></mce:script>
總結
以上是生活随笔為你收集整理的N秒钟后自动跳转的html页面,javascript的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 文件打开数设置, too m
- 下一篇: Red hat下使用automake自动