這個(gè)代碼怎么錯(cuò)了
<!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 open=confirm("確認(rèn)打開(kāi)網(wǎng)站嗎?");
if(open==true)
?{
var GG=prompt("確定打開(kāi)魔王的飽和么","http://www.baidu.com/");
} ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
if(GG!=null)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
{ ? ?
window.open(GG,"_blank",'width=500,height=600');
}
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
else
{alert("再見(jiàn)!");}
} ??
else
{alert("再見(jiàn)!");}
? ? }
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
這個(gè)怎么錯(cuò)了
2017-07-08
要改的話可以換成
if{
????if{
????}
????else{
????}
}
else{
}
2017-07-06
兩個(gè)ELSE連在了一起語(yǔ)句變成了 ? if{}if{}else{}else{} 所以錯(cuò)了