easypass

     javascript中window.close()函数用来关闭窗体,而且IE、google、firefox浏览均支持,但由于firefox浏览器dom.allow_scripts_to_close_windows参数默认值为false,故close不启作用。

    首先在firefox地址栏中输入about:config然后找到dom.allow_scripts_to_close_windows参数设置为true即可,如下图所示:

附 IE、google、firefox通用关闭窗口方法

 function closeWindow() {
           var browserName = navigator.appName;
           if (browserName == "Netscape") {
               window.open(\'\', \'_self\', \'\');
               window.close();
           }
           else {
               if (browserName == "Microsoft Internet Explorer") {
                   window.open(\'\', \'_parent\', \'\');
                   window.close();
               }
           }
       }

分类:

技术点:

相关文章:

  • 2022-02-17
  • 2022-02-11
  • 2021-12-05
  • 2022-12-23
  • 2021-12-01
  • 2021-07-20
  • 2021-12-21
  • 2021-12-13
猜你喜欢
  • 2022-02-10
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
相关资源
相似解决方案