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