代碼不能運(yùn)行,誰(shuí)幫忙看看!
<!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("是否打開(kāi)網(wǎng)頁(yè)?");
? ? if (open == true)
? ? {
? ? var url = prompt ("請(qǐng)輸入要打開(kāi)的網(wǎng)址","http://idcbgp.cn/");
? ? if (url ! = null)?
? ? {
? ? ? ?window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no') ;
? ? }
? ? else?
? ? {
? ? alert("再見(jiàn)!");
? ? }
? ? }
? ? else
? ? {
? ? alert("再見(jiàn)!");
? ? }
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-11-25
if(url != null) 感嘆號(hào)和等號(hào)之間不要有空格