請(qǐng)問哪里錯(cuò)了?
<script type="text/javascript">??
? ? function openWindow()
? ? {
? ? ? ? var open=confirm("是否打開新窗口");
? ? ? ? if(open==ture)
? ? ? ? {
? ? ? ? ? ? var open2=prompt("確認(rèn)打開網(wǎng)址,http://idcbgp.cn/");
? ? ? ? ? ? if(open!=null)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(open2,'_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? alert("再見!");
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見!");
? ? ? ? }
? ? }
? ? // 新窗口打開時(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>
能彈出是否打開新窗口的對(duì)話框,但點(diǎn)擊確認(rèn)按鈕后對(duì)話框不見了也沒有其他反應(yīng)。
2018-10-26
自己找到問題了。。??扌Σ坏?,true拼錯(cuò)了。。。
2018-10-24
你沒有給windo.open打開的地址