為啥按按鈕沒反應(yīng)?
<!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 wow=comfirm("???");
? ? if(wow=true)// 新窗口打開時彈出確認框,是否打開
? ? {var url=prompt("open it","http://idcbgp.cn");
? if (url!=null) ?// 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? {window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');
}
? ?else?
? ?{alert("bye!");}
? ? ??
? }//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? else
? ? ? ? {alert("bye!!!");}
? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-07-08
你的http:冒號是中文的也不行,
要英文的http:才可以.
2019-07-08
wow=comfirm("???");函數(shù)是confirm()
2019-07-08
你里面if(wow=true)是不對的;這是賦值,不是比較。