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();

问题解决

转载于:https://www.cnblogs.com/stanley107/archive/2012/06/14/2548993.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值