1 回答

TA貢獻(xiàn)33條經(jīng)驗 獲得超4個贊
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>Document</title>
</head>
<body>
? ? <script>
? ? function openWindow() {
? ? ? ? var open = confirm("打開新的窗口!");
? ? ? ? if (open == true) {
? ? ? ? ? ? var pro = prompt("輸入新的網(wǎng)址",
? ? ? ? ? ? ? ? "http://idcbgp.cn");
? ? ? ? ? ? if (pro != null) {
? ? ? ? ? ? ? ? window.open(pro, "_blank", 'width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? alert("再見")
? ? ? ? ? ? }
? ? ? ? } else {
? ? ? ? ? ? alert("再見!")
? ? ? ? }
? ? }
? ? openWindow();
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? </script>
</body>
</html>
"輸入新的網(wǎng)址" 后面的逗號寫錯了
添加回答
舉報