這段代碼哪里有問題?為什么按按鈕沒反應的
找了很久,沒找出來問題。。。求大神指點
<!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 conweb=confirm("是否要打開網站");
? ? ? ??
? ? ? ? if(conweb==true){
? ? var myweb=prompt("輸入你要打開的網址","http://www.xianlaiwan.cn/");}
? ?
? ? ? ? if myweb!=null{
? ? window.open(myweb,"_blank","width=400px,height=500px,menubar=no,toolbar=no");}
? ??
? ? ? ? else {
? ? ? ? alert("結束");}
? ? }
? </script>?
?</head>?
?<body>?
? ? ? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2015-12-02
myweb!=null要加的,用括號括起來。
2015-11-29
知道問題在哪了。。。謝謝
? if myweb!=null{ 這個部分是不是沒必要加的