為什么代碼在hbuild中顯示不了,請(qǐng)問(wèn)代碼有寫錯(cuò)嗎
<!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 comfirm("是否要打開(kāi)新網(wǎng)站");
? ? ? ? if(open==true)
? ? ? ?{
? ? ? ? var myname=prompt("http://idcbgp.cn/");
? ? ? ?
? ? ? ?if(myname!=null)
? ? ? ?{window.open("http://idcbgp.cn/","width=400,height=500,nenubar=no,toolbar=no");
? ? }
? ? }
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-03-25
var comfirm("是否要打開(kāi)新網(wǎng)站");錯(cuò)誤
應(yīng)為:var open=comfirm("是否要打開(kāi)新網(wǎng)站");