กลับมาโดยอัตโนมัติหลังจาก 1.3 วินาที
การคัดลอกรหัสมีดังนี้:
<span id = "totalsecond"> 3 </span> ส่งคืนโดยอัตโนมัติหลังจาก 3 วินาที
<script language = "javascript" type = "text/javascript">
-
var second = document.getElementById ('totalsecond'). textContent;
if (navigator.appname.indexof ("Explorer")> -1) // ตัดสินว่าเป็นเบราว์เซอร์ IE หรือเบราว์เซอร์ Firefox และใช้มาตรการที่สอดคล้องกันเพื่อรับจำนวนวินาที
-
second = document.getElementById ('totalsecond'). innerText;
} อื่น
-
second = document.getElementById ('totalsecond'). textContent;
-
setInterval ("redirect ()", 1,000);
ฟังก์ชั่นเปลี่ยนเส้นทาง ()
-
ถ้า (วินาที <0)
-
location.href = 'http://www.baidu.com';
} อื่น
-
if (navigator.appname.indexof ("Explorer")> -1)
-
document.getElementById ('totalsecond'). innerText = วินาที-;
} อื่น
-
document.getElementById ('totalsecond'). textContent = วินาที-;
-
-
-
-
</script>