求解哪里有錯(cuò)誤,已經(jīng)卡了好久。
<!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("新窗口打開網(wǎng)站");
????? if(open==true)
????? {
?????? var url=prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn");??
?????? if(url!=null)
?????? {
?????????? window.open(url,'_blank','witdh=400 height=500');
?????? }
?????? else
?????? {
?????????? alert("null");
?????? }
?????? else
?????? {
?????????? alert("null2")
?????? }
????? }
}
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
2017-04-04
語法錯(cuò)誤,if語句有if_else、if_else if_else兩種,刪除下面的即可運(yùn)行
else? {
?????????? alert("null2")
?}
2017-04-04
不熟悉