為什么我網(wǎng)址輸入錯(cuò)誤的時(shí)候彈不出來(lái)重新輸入, 是否確認(rèn)打開(kāi)選否,也不會(huì)出現(xiàn)不打開(kāi)的字樣
<!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 m=confirm("是否確認(rèn)打開(kāi)");
? ? ?if(m==true)
? ? ?{
? ? ? ? ?var n=prompt("輸入網(wǎng)址:");
? ? ? ? ?if(n=="http://idcbgp.cn/")
? ? ? ? ?{? window.open("http://idcbgp.cn/","_blank",width=400px,height=500px);
? ? ? ? ?}
? ? ? ? ?else{
? ? ? ? ? ? ?alert("輸入錯(cuò)誤,請(qǐng)重新輸入!");
? ? ? ? ?}
? ? ?}
? ? ?else{
? ? ? ? ?document.write("你選擇不打開(kāi)");
? ? ?}
?}
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2021-08-22
1、沒(méi)有調(diào)用函數(shù),
2、設(shè)置菜單欄和工具欄 沒(méi)有加""