zoukankan      html  css  js  c++  java
  • window.close 在firefox无效问题

       window.close 在firefox无效,有解决方案是改firefox设置

         Firefox地址栏里输入 about:config
        在配置列表中找到 dom.allow_scripts_to_close_windows
        点右键的选切换把上面的false修改为true即可。

     这种方法要求每个用户都这样来一遍,不太可能。。。

    解决方法:

     var rand = parseInt(Math.random() * 100 + 1);
            var rv = window.showModalDialog('Redirect.htm?ID=' + ID + '&rand=' + rand, '', "dialogWidth=680px;dialogHeight=580px;help:no;");

    Redirect.htm:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
     <head>
      <title>按模板导出Excel</title>
      <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
      <meta name="ProgId" content="VisualStudio.HTML">
      <meta name="Originator" content="Microsoft Visual Studio .NET 7.1">
      
      <meta http-equiv="Pragma" content="no-cache">
      <meta http-equiv="no-cache">
      <meta http-equiv="Expires" content="-1">
      <meta http-equiv="Cache-Control" content="no-cache">
      
      <base target="_self" />
      
      <script language="javascript">
          function Load() {
              window.Code.location.href = 'DepartmentEdit.aspx' + window.location.search;
          }
      </script>
     </head>
     <body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0 onload="Load()">
      <table width=100% height=100% border=0 cellpadding=0 cellspacing=0>
       <tr>
        <td>
         <iframe id=Code name=Code frameborder=0 height=100% width=100% scrolling="yes"></iframe>
        </td>
       </tr>
      </table>
     </body>
    </html>


     

    DepartmentEdit.aspx

    parent.window.close();

    问题解决

  • 相关阅读:
    程序猿和产品狗
    编写一个友元函数,求两个日期之间相差的天数
    集合的模拟实现(类模板)
    友元很简单2016final
    攻防世界-parallel-comparator-200
    web-GXYCTF2019 StrongestMind
    破解010Editor
    2020第三届江西省高校网络安全技能大赛线下解题赛部分wp
    pwn-EasyHeap(House of spirit)
    web-2020 ciscn littlegame(原型链污染)
  • 原文地址:https://www.cnblogs.com/stanley107/p/2548993.html
Copyright © 2011-2022 走看看