檢查不出來我的代碼有什么問題啊- -。
<!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("是否打開新窗口");
? ? if(open==ture)
? ? {var url=prompt("確認(rèn)打開的網(wǎng)址"," http://idcbgp.cn");
? ? if(url!=null)
? ? {window.open(url,"_blank",'width=400,height=500,menubar=no,toolbar=no');}
else
{alert("再見!");}
} ??
else
{alert("再見!");}
? ? }
? ??
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-04-16
1、var url=prompt("確認(rèn)打開的網(wǎng)址"," http://idcbgp.cn"? ?逗號(hào)
2、?if(open==ture) ? true
2016-04-16
if(open==ture)改為if(open==true)
2016-04-16
第九行代碼 ?你將true寫錯(cuò)成ture了;還有第10行代碼,你兩個(gè)參數(shù)中間的逗號(hào)使用了中文的逗號(hào),以及網(wǎng)址里面的冒號(hào)也是使用的中文的冒號(hào),都改成英文的就好了,在我的電腦上執(zhí)行是這樣的。
2016-04-16
第一個(gè)if判斷語句的 true 拼錯(cuò)了