我正在使用此代码来检测浏览器的弹出窗口阻止程序。当前脚本在 chrome 和 firefox 中运行良好,但在 IE 浏览器中运行良好。在 IE 中,天气弹出窗口打开或关闭警报正在由 IE 检测。
<html>
<head>
<title>Contentverse Online</title>
</head>
<script>
function closeCurrentWindow() {
var version=0;
if (navigator.appVersion.indexOf("MSIE")!=-1){
var temp=navigator.appVersion.split("MSIE");
version=parseFloat(temp[1]);
}
if (version>=5.5 && version<=6) {
this.focus();
self.opener = this;
self.close();
} else {
window.open('','_parent','');
window.close();
}
}
</script>
<body>
<script>
var newWin = window.open("Sign.asp?Home=C:/Program Files/ViewWise Online&VWOFlavor=Full","myWindow",'top=0,left=0,width='+screen.width+',height='+screen.height+',status=yes,resizable=no,scrollbars=yes');
if (!newWin || newWin.closed || typeof newWin.closed == 'undefined' || newWin.outerHeight == 0){
alert("Please Enable Popup For this Site...");
}
else
{
}
</script>
</body>
</html>