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