当前位置: 代码迷 >> ASP.NET >> window.close()在FF下无效,该怎么解决
  详细解决方案

window.close()在FF下无效,该怎么解决

热度:2846   发布时间:2013-02-25 00:00:00.0
window.close()在FF下无效
JScript code
<script type="text/javascript">                            function closeWindow() {                                var appName = navigator.appName;                                if (appName == "Microsoft Internet Explorer") {                                    window.close();                                }                                else {                                    //window.opener = null;                                    window.open(window.location.href, "_self",'');                                    window.close();                                }//在 chrome 、IE 没问题 ,在FF中无效,难道必须手动修改FF配置??                            }                        </script>


------解决方案--------------------------------------------------------
<script> 
window.opener=null; 
window.open('','_self'); 
window.close(); 
</script> 

果断试一下
------解决方案--------------------------------------------------------
把前面的window.open(window.location.href, "_self",'');注释掉试一试。


------解决方案--------------------------------------------------------
我的解决方案http://blog.csdn.net/bdstjk/article/details/7473748
JScript code
    <script type="text/javascript">        function CloseWebPage() {            if (navigator.userAgent.indexOf("MSIE") > 0) {                if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {                    window.opener = null; window.close();                }                else {                    window.open('', '_top'); window.top.close();                }            }            else if (navigator.userAgent.indexOf("Firefox") > 0) {                window.location.href = 'about:blank ';                //window.history.go(-2);            }            else {                window.opener = null;                 window.open('', '_self', '');                window.close();            }        }    </script>
------解决方案--------------------------------------------------------
探讨

我的解决方案http://blog.csdn.net/bdstjk/article/details/7473748
JScript code
<script type="text/javascript">
function CloseWebPage() {
if (navigator.userAgent.indexOf("MSIE") > 0)……

------解决方案--------------------------------------------------------
探讨

我的解决方案http://blog.csdn.net/bdstjk/article/details/7473748
JScript code
<script type="text/javascript">
function CloseWebPage() {
if (navigator.userAgent.indexOf("MSIE") > 0)……

------解决方案--------------------------------------------------------
探讨

我的解决方案http://blog.csdn.net/bdstjk/article/details/7473748
JScript code
<script type="text/javascript">
function CloseWebPage() {
if (navigator.userAgent.indexOf("MSIE") > 0)……
  相关解决方案