課程
/前端開發
/JavaScript
/JavaScript入門篇
不管輸什么都是打開慕課網,而且卡住不顯示
2019-03-28
源自:JavaScript入門篇 2-7
正在回答
W大寫
<script type="text/javascript">??
? ? function openWindow()
? ? // 新窗口打開時彈出確認框,是否打開
{? ?var message=confirm("是否打開對話框?");
? ? if(message==true)
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ?{? ensure=prompt("請輸入網址","http://www.xianlaiwan.cn")
? ? window.open('ensure','_blank','width=400,height=500,menubar=no,toolbar=no')}
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
}??
? </script>?
為什么跳轉后的頁面網址是這樣的,什么都不顯示?
<!DOCTYPE html><html>?<head>? <title> new document </title>? ? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>?? ? <script type="text/javascript">? ??? function openwindow(){?? var ensure=confirm("是否打開");??? ??? if(ensure==true){??????? web=prompt("輸入你要打開的網址",'http://www.pronhub.com');??? window.open("web","-blank",'menubar=no,toolbar=no, status=yes,scrollbars=yes')}??? ??? }??? // 新窗口打開時彈出確認框,是否打開
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。??? ??? ? </script> ?</head> ?<body> ?? <input type="button" value="新窗口打開網站" onclick="openwindow()" /> ?</body></html> ? ? ? ? ? 貼個代碼你們感受一下
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
5 回答為什么打不開網站
4 回答為什么打不開網站啊
4 回答為什么打不開慕課網站
4 回答為什么點擊新窗口打開網站打不開?
1 回答為什么網站打開是空白的?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-04-01
W大寫
2019-03-31
<script type="text/javascript">??
? ? function openWindow()
? ? // 新窗口打開時彈出確認框,是否打開
{? ?var message=confirm("是否打開對話框?");
? ? if(message==true)
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ?{? ensure=prompt("請輸入網址","http://www.xianlaiwan.cn")
? ? window.open('ensure','_blank','width=400,height=500,menubar=no,toolbar=no')}
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
}??
? </script>?
2019-03-31
2019-03-28
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>??
? <script type="text/javascript">?
??? function openwindow(){
?? var ensure=confirm("是否打開");???
??? if(ensure==true){
??????? web=prompt("輸入你要打開的網址",'http://www.pronhub.com');
??? window.open("web","-blank",'menubar=no,toolbar=no, status=yes,scrollbars=yes')}
???
??? }
??? // 新窗口打開時彈出確認框,是否打開
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
???
???
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openwindow()" />
?</body>
</html> ? ? ? ? ? 貼個代碼你們感受一下