求大神幫我看看哪錯了
<!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 a00=confirm("是否新建窗口網站") ;
??? if(a00==true)
??? {
??????? var b11=prompt("確認網址","http//www.xianlaiwan.cn/");
??????? if(b11==null)
??????? {
??????????? window.open('http//www.xianlaiwan.cn/','_blank','width=400px,heught=500px,menubar=no,toolbar=no');
??????? }
??????? else{
??????????? document.write("錯誤");
??????? }
???????????
???? }
??????? else{
??????????? document.write("錯誤");
??????? }
??? }
??? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2018-08-17
正解:if(b11!=null)
????{
? ? ? ? ? window.open ('_blank','width=400px,heught=500px,menubar=no,toolbar=no');
??????? }
兩個錯誤,第一:當不輸入時,因為第二參數已賦值,確認后直接跳轉默認網頁,取消則返回為null。第二window.open第一參數為網頁路徑,可為空或不寫。