怎么顯示不了確認(rè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 blank=confirm("想進(jìn)入xx的世界么");
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ? if(blank==true)
{var top=prompt("點(diǎn)擊確定小xx為你跳舞","http://www.baidu.com");
? ??
if(top!=null)
? ? ? ?// 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/?
{window.open(top,"_blank",'width400,height500,menubar=no,toolbar=no');}
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? else
? ? {alert("算你還有良知");}
? ? }
? ?else
? ? {alert("。。。!");}
}
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-10-24
找到了,原來是中文分號逗號在作祟。。。