在Firefox中关闭窗口 [英] close window in firefox

查看:114
本文介绍了在Firefox中关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下js函数

i have following js function

function closeMe()
{
    window.open('','_parent','');
    window.close();
}



用于关闭窗口,使其在IE上有效,但在Firefox上将不起作用
在Firefox上使用关闭按钮的任何功能,请建议我.



for closing window its working on IE,But it will not work on firefox
any function for close button working on firefox please suggest me.

推荐答案

您可以看到此链接
点击
在这里,给出了3个解决方案.
you can see this link
Click
Here, 3 solutions are given.


这可能是您要寻找的内容:
That might be what you are looking for:
function closeWindow() {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
    alert("This will close the window");
    window.open('','_self');
    window.close();
}



祝你好运



Good luck


win.open返回对打开的窗口的引用
试试这个代码

win.open return a reference to the open window
try this code

var myWin = window.open('','_parent','');
myWin.close();




会起作用的

mithun thakur




it will work

mithun thakur


这篇关于在Firefox中关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆