課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
各位幫忙看看哪里有問題,我點擊沒有反應(yīng)。哪位有有正確的代碼,傳上來一份研究下,謝謝
2016-12-09
源自:JavaScript入門篇 2-7
正在回答
? function openWindow(){
? ? var lianxi=confirm('是否打開網(wǎng)頁?');
? ? // 新窗口打開時彈出確認框,是否打開
? ? if (lianxi==true)
? ? {
? ? ? var lx=window.open('http://idcbgp.cn','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? document.write(lx);
? ? }
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? else{
? ? ??
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
functiom?openWindow() { ?var?message=confirm("確定打開窗口嗎?") ?if?(message=true) ?{ ?window.open(‘http://imooc.com’,‘width=400’,‘height=500’); ?} } 你試試,我是可以的
舉報
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
4 回答哪里有問題嗎?
2 回答求問哪里有問題?
3 回答請問哪里有問題?
1 回答想問問哪里有問題??
2 回答請問我哪里有問題嗎?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-12-13
? function openWindow(){
? ? var lianxi=confirm('是否打開網(wǎng)頁?');
? ? // 新窗口打開時彈出確認框,是否打開
? ? if (lianxi==true)
? ? {
? ? ? var lx=window.open('http://idcbgp.cn','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? document.write(lx);
? ? }
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? else{
? ? ??
? ? }
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-12-09