我的代碼為什么else哪里顯示錯誤?
<!DOCTYPE?html>
<html?lang="en">
<head>
????<meta?charset="UTF-8">
????<meta?name="viewport"?content="width=device-width,?initial-scale=1.0">
????<meta?http-equiv="X-UA-Compatible"?content="ie=edge">
????<title>Document</title>
????<script>
????function?openWindow()
????{var?a=confirm("確定打開窗口?");
????if(a==true)
????{
????????var?nul=prompt("通過輸入對話窗口,確定打開網(wǎng)址","http://idcbgp.cn");
????????if(nul!=null)
????????{
????????????window.open(nul,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');
????????}
????????else{alert("打開失敗");}
????????else{alert("打開失敗");}
????}
}
????</script>
</head>
<body>
????????<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>
</body>
</html>
我第二個else為什么一直顯示錯誤求大佬幫我回答一下
2019-09-29
你兩個else對應同一個if了
2019-09-19
如圖所示: