大神幫忙看一看哪有問題找半天了。
<!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 a=confirm("是否打開新窗口");
? ? ? ? if(a==true)
? ? ? ? {
? ? ? ? ? ? var b=prompt("確定打開HTTP://idcbgp.cn網(wǎng)址嗎?","http://widcbgp.cn");
? ? ? ? ? ? if (b!=null)
? ? ? ? ? ? {
? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,toobar=no');
? ? ? ? }
? ? ? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見");
? ? ? ? }
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? alert("再見");
? ? ? ? }
? ? }
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-06-06
其他地方
第二個alert分號是中文
window.open('http://idcbgp.cn','_blank','width=400,height=500,toobar=no');?toolbar寫錯了,'http://idcbgp.cn'也可以直接寫成b
2018-06-06
?function openWindow() ?這寫錯了,所以沒有彈出
2018-06-05
b==true
2018-06-05
function openWindow() ? 代碼中的= 去掉了還是不對