我的代碼這樣寫有什么問題嗎,為什么不對(duì)?
<!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 open=confirm("是否打開窗口?")
? ? ? ? if(open==true)
? ? ? ? {var url=prompt("通過輸入對(duì)話框,確定打開的網(wǎng)址","http://idcbgp.cn");
? ? ? ? if(url!=null){window.open(url,"_blank""width:400,height:500,menubar=no,toolbar=no");}
? ? ? ? else{alert("再見!");}
? ? ? ? }
? ? ? ? else{alert("再見!");}
? ? ? ? }
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-12-02
open==true ?是一個(gè)等號(hào) ?
2015-11-27
你的代碼中錯(cuò)誤很多,我改好了,你復(fù)制,粘貼運(yùn)行一下看看吧