求幫我看看哪里出問(wèn)題了??
<!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 wopen=confirm("是否打開(kāi)?");
? ? if(wopen==true)
? ? {
? ? var isopen=prompt("請(qǐng)輸入要打開(kāi)的網(wǎng)址:","http://idcbgp.cn");
? ? ? ? if(isopen!=null)
? ? ? ? {
? ? ? ? window.open(isopen,"_blank",'width=400,height=500 ? ? ? ?,manubar=no,toolbar=no')
? ? ? ??
? ? ? ? }
? ? ? ? else{alert("再見(jiàn)!")}
? ??
? ? }
? ? else{alert("再見(jiàn)!")}
? ??
}
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話(huà)框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-12-17
<title>和<meta>換下位置,初學(xué)代碼應(yīng)該寫(xiě)標(biāo)準(zhǔn)點(diǎn),manubar拼寫(xiě)錯(cuò)誤 ?應(yīng)是menubar,解決亂碼,把charset=gbk換成charset=utf-8
2015-12-17
代碼沒(méi)問(wèn)題的,你把它放到本地用chrome測(cè)試一下,應(yīng)該是可以的
2015-12-17
你的瀏覽器攔截新窗口了吧?很多瀏覽器都是默認(rèn)攔截新窗口的,設(shè)置一下就好了
2015-12-17
好像沒(méi)什么問(wèn)題,可能是在線(xiàn)驗(yàn)證出了問(wèn)題,有時(shí)候會(huì)有誤判的