課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
http://idcbgp.cn/code/idcbgp.cn
代碼就是練習(xí)的啊。。哪里有問題呢?
2017-09-21
源自:JavaScript入門篇 2-7
正在回答
<!DOCTYPE?html> <html> ?<head> ??<title>?new?document?</title>?? ??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>??? ??<script?type="text/javascript">?? ????function?openWindow(){ ????//?新窗口打開時(shí)彈出確認(rèn)框,是否打開 ????var?flag=confirm("是否打開網(wǎng)頁(yè)"); ????//?通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/ ????if(flag==true){ ????????var?str?=?prompt("請(qǐng)輸入要打開的網(wǎng)頁(yè)","http://idcbgp.cn/"); ???? ????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ????????window.open(str,'_blank','width=400px,height=500px,toolbar=no,menubar=no'); ????} ????} ???? ??</script>? ?</head>? ?<body>? ??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>? ?</body> </html>
網(wǎng)址有前綴http://
落葉蕭蕭online 提問者
要遵守http協(xié)議吧
<!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?str; ????str=confirm("是否打開新的網(wǎng)站"); ????//?新窗口打開時(shí)彈出確認(rèn)框,是否打開 ????if(str==true){ ????????var?str1; ????????str1=prompt("請(qǐng)輸入您要打開的網(wǎng)址","idcbgp.cn"); ????} ????//?通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/ ????if(str==true){ ????????window.open(str1,'_blank','width=400,height=500,menubar=no,toolbar=no'); ???????? ????} ????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ??} ???? ??</script>? ?</head>? ?<body>? ??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>? ?</body> </html>
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
3 回答為什么我的是在目前網(wǎng)頁(yè)地址的基礎(chǔ)上再在此地址后面加入新地址打開網(wǎng)頁(yè)
3 回答為什么我打開的新網(wǎng)頁(yè)的網(wǎng)址不對(duì)
2 回答我這個(gè)咋又給我打開了一個(gè)新的主網(wǎng)頁(yè)呢 是不是因?yàn)闉g覽器的原因
4 回答打開不了地址網(wǎng)頁(yè)http://idcbgp.cn
3 回答打開的網(wǎng)頁(yè)地址多了本地的路徑
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-09-21
網(wǎng)址有前綴http://
2017-09-21
要遵守http協(xié)議吧
2017-09-21