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