禁止弹出“您查看的网页正在试图关闭窗口。是否关闭此窗口”的屏蔽方法 .

 在IE6中范例代码如下:
window.opener= null;
window.close();

在IE7中示例代码如下

window.opener= null;
window.open("","_self");
window.close();

如果要全屏显示(去掉IE的工具栏、地址栏和菜单栏等信息),则只能用window.open();的方法。如果第一个页面就要全屏显示,则需要设置一个中转页面。中转页面代码如下:(body中什么都不必写)

<head>
    <title></title>
    <script type="text/javascript" >
        function openwindow() {
            window.open('pos_search.htm', 'newwindow', 'fullScreen=1, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
            window.opener = null;
            window.open("", "_self");
            window.close();
        }
    </script>
</head>
<body οnlοad="openwindow()">

</body>
</html>

 

 

 

 

function init2(){
 var browser=navigator.appName;
 var b_version=navigator.appVersion;
 var version=b_version.split(";");
 var trim_Version=version[1].replace(/[ ]/g,"");
 if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") {
  alert("IE 6.0");
     window.opener = null;
     window.close();
     window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
 } else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") {
  alert("IE 7.0");
  window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
  window.opener = null;
     window.open("", "_self");
     window.close();
 } else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") {
  alert("IE 8.0");
  window.open('<%=path%>/exam/logon2.jsp','_blank','fullscreen=yes,top=0,left=0,status=yes,menubar=no,scrollbars=yes,resizable=yes');
  window.opener = null;
     window.open("", "_self");
     window.close();
 }
 else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0") {
     alert("IE 9.0");
 }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值