課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
2.7的練習(xí)不會 555
2017-02-03
源自:JavaScript入門篇 2-7
正在回答
window是關(guān)鍵字
你的var window=confirm("是否打開新窗口");這句變量名改成別的
qq_浮雲(yún)遊子_03977413 提問者
<!DOCTYPE?html> <html> ?<head> ??<title>?new?document?</title>?? ??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>??? ??<script?type="text/javascript">?? ????function?openWindow(){ ????????//?新窗口打開時彈出確認(rèn)框,是否打開 ????????var?mymessage=confirm("確定要打開嗎?"); ????????if?(mymessage==true){ ????????????//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/ ????????????var?mind=prompt("您是要打開下面的網(wǎng)址嗎?","http://idcbgp.cn/"); ????????????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ????????????if?(mind=="http://idcbgp.cn/"){ ????????????????window.open("http://idcbgp.cn/","_blank","width=400,height=500,menubar=no,toolbar=no"); ????????????} ????????} ????} ??</script>? ?</head>? ?<body>? ??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>? ?</body> </html>
慕粉2156348289
<!DOCTYPE?html> <html> ?<head> ??<title>?new?document?</title>?? ??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>??? ??<script?type="text/javascript">?? ????function?openWindow(){ ????//?新窗口打開時彈出確認(rèn)框,是否打開 ????????var?mind=prompt("確定打開嗎?","http://idcbgp.cn"); ????????//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/ ????????if?(mind=="http://idcbgp.cn"){ ????????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ????????????window.open("http://idcbgp.cn","_blank","width=400,height=500,menubar=no,toolbar=no"); ????}}; ??</script>? ?</head>? ?<body>? ??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>? ?</body> </html>
舉報
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
4 回答哪位能幫我解答一下
5 回答請各位老師幫忙解答下,我這個答案是為什么運(yùn)行不了呢?
2 回答我的答案喲
1 回答求大神,幫我解答一下我的哪錯了,感激不盡!
2 回答我有個問題,希望各位能幫我回答一下
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-02-03
window是關(guān)鍵字
你的var window=confirm("是否打開新窗口");這句變量名改成別的
2017-02-03
2017-02-03