(跳轉(zhuǎn)提示頁面)這代碼以后用得上
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> ??
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <p>操作成功</p>
? <span id="countTime"></span> <a href='javascript:goBack()'>返回</a>
?
? <script type="text/javascript"> ?
? ? var second = 5;
? ?//獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
? ? var message = document.getElementById("countTime");
? ? function clock()
? ? {
? ? ? ? if(second==0)
? ? ? ? {
? ? ? ? ? ? goTo();
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? message.innerHTML = second-- + "秒后回到主頁";
? ? ? ? ? ? window.setTimeout(clock,1000);
? ? ? ? }
? ? }
? ? clock();
? ?//通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。
? ?function goTo()
? ?{
? ? ? ? window.location.;
? ?}
? ?function goBack()
? ?{
? ? // ? window.history.Back();
? ? ? ? window.location.;
? ?}
?</script>?
</body>
</html>
2015-12-22
收藏了,贊