課程
/前端開發(fā)
/JavaScript
/JavaScript進階篇
為啥我返回那里一直回不去哦,我之前打開過頁面呀
2015-07-22
源自:JavaScript進階篇 8-17
正在回答
就這個不知道哪里出錯了返回不管用
<!DOCTYPE html><html>?<head>? <title>瀏覽器對象</title> ?? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ??</head>?<body>? <!--先編寫好網(wǎng)頁布局-->??? <p style="font-size:24px;font-weigth:bold;">??? 操作成功??????? </p>??? <div style="margin-top:20px;">??? <span id="count">??????? 5 ??? </span>?????? 秒后回到主頁????? ?????? <a onclick="window.history.back()">????????? 返回?????? ?????? </a>??? </div>?? <script type="text/javascript"> ???? //獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。???? var num=5;???? setInterval("Time()",1000);?? function Time(){?????? document.getElementById("count").innerHTML=num;?????? num=num-1;??? if(num==1){??????? location.assign("http://www.baidu.com");??? } ?????? }??? ??? //通過window的location和history對象來控制網(wǎng)頁的跳轉。???? ??</script> </body></html>
沒有代碼誰幫你找茬
舉報
本課程從如何插入JS代碼開始,帶您進入網(wǎng)頁動態(tài)交互世界
2 回答單擊返回沒有跳轉到歷史頁面。
1 回答點擊返回跳轉上一次瀏覽,并刷新頁面
4 回答js 8-17練習(網(wǎng)頁跳轉和返回)
3 回答為什么點返回鍵不直接跳轉網(wǎng)頁
3 回答為什么點擊“返回”的時候跳轉到空白頁。。
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2015-07-27
就這個不知道哪里出錯了返回不管用
2015-07-27
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
??? <p style="font-size:24px;font-weigth:bold;">
??? 操作成功
??????? </p>
??? <div style="margin-top:20px;">
??? <span id="count">
??????? 5
??? </span>
?????? 秒后回到主頁
????? ?
????? <a onclick="window.history.back()">
????????? 返回?????? ?
????? </a>
??? </div>
?
? <script type="text/javascript"> ?
?
?? //獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
???? var num=5;
???? setInterval("Time()",1000);
?? function Time(){
?????? document.getElementById("count").innerHTML=num;
?????? num=num-1;
??? if(num==1){
??????? location.assign("http://www.baidu.com");
??? }
?????? }
??? ?
?? //通過window的location和history對象來控制網(wǎng)頁的跳轉。
???? ?
?</script>
</body>
</html>
2015-07-22
沒有代碼誰幫你找茬