為什么沒有窗口彈出來?
<!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 ask=comfirm("open?");
? ? if (ask==true)
? ? {
? ? ? ? var web=prompt("address?","http://www.xianlaiwan.cn/");
? ? ? ? if (web!=null)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(web,"_blank","height=500,width=400,menubar=no,toolbar=no");
? ? ? ? ? ? }
? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open("http://www.xianlaiwan.cn/","_blank","height=500,width=400,menubar=no,toolbar=no")
? ? ? ? ? ? }
? ? }
? ? else
? ? ? ? alert("no")
? ?}
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()"/>?
?</body>
</html>
麻煩幫我看一看哪里出了問題qwq
2019-03-12
confirm寫錯了
2019-03-13
為什么if里面還要嵌套一個if?求解 看不懂
2019-03-12
http://www.xianlaiwan.cn? 冒號? http://www.xianlaiwan.cn