先尝试弹出,然后等若干毫秒,看看弹出窗口对象是否变为null了,如果是那么就是被关闭了。

解决方案 »

  1.   

    去看webmessenger.msn.com上面的脚本
      

  2.   

    1.html<html>
    <body>
    <script>
    var url = "2.html"; //测试弹出窗口页面var handle = null;
    try {
    handle = window.open(url, "", "")
    } catch (e) {
    }
    if (handle==null)
    alert("IE已禁止弹出窗口");var returnValue = null;
    try {
    //注意url指定页面应返回值, 例:<body onunload="window.returnValue='aaa'">
    returnValue = window.showModalDialog(url, "", "")
    } catch (e) {
    }
    if (returnValue==null)
    alert("IE已禁止弹出窗口");
    </script>
    </body>
    </html>2.html
    <html>
    <body onunload="window.returnValue='aaa'">
    aaaa
    </body>
    </html>
      

  3.   

    <script language="javascript">
    <!--Athor:www.msii.cn-->
    var handle = null;
    try{
    handle = window.open('','','width=0,height=0');
    do{if(null == handle || true == handle.closed){alert('IE已禁止弹出窗口,部分操作可能导致无效!');break;};handle.close();handle=null;}while(false);
    }catch(ex){}
    if(null != handle)try{if(!handle.closed)handle.close();}catch(ex){}
    </script>