1 回答

TA貢獻(xiàn)33條經(jīng)驗(yàn) 獲得超4個(gè)贊
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>Document</title>
</head>
<body>
? ? <script>
? ? function openWindow() {
? ? ? ? var open = confirm("打開(kāi)新的窗口!");
? ? ? ? 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("再見(jiàn)")
? ? ? ? ? ? }
? ? ? ? } else {
? ? ? ? ? ? alert("再見(jiàn)!")
? ? ? ? }
? ? }
? ? openWindow();
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? </script>
</body>
</html>
"輸入新的網(wǎng)址" 后面的逗號(hào)寫(xiě)錯(cuò)了
添加回答
舉報(bào)