為什么我的代碼打不開?
?function openwindow()?
? ?{ ?var one=confirm("是否打開新窗口?");
? ?if(one==true)
? ?{ ?var two=prompt("確定打開的網(wǎng)址","http://idcbgp.cn/");
? ?if(two!=null)
? ?{window.open('two','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ?else
? ?{alert("再見");}
? ?}
? ?else
? ?{alert("再見");}
? ?}
2017-09-16
<!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 message=confirm("是否打開新窗口?");
? ? ? ? if(message==true)
? ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? ? ? ?{var choose=prompt("請輸入要打開的網(wǎng)址","http://idcbgp.cn/");}
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? ? ? ? window.open(choose,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ?
? ? ? ??
? ? ? ? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-09-15
代碼都不完整看什么啊
2017-09-15
找到原因了 ??function openwindow() ? ? ? openWindow ?第二個單詞首字母要大寫
2017-09-15
window.open('two','_blank','width=400,height=500,menubar=no,toolbar=no');
這個two是個變量,不用加‘’號
2017-09-15
有沒有大神幫忙看一看
2017-09-15
有沒有人幫忙看一下