我正在尝试通过单击按钮关闭当前窗口。我知道 window.close() 只能在窗口由 javascript 拥有时才能工作。
所以我以前用过window.open()
,然后像这样关闭那个窗口:
self.name = "close";
window.open("","close");
self.opener = null;
self.close();`
这适用于 Chrome 和旧版本的 Firefox,但不适用于 FF14。那么如何在FF14中关闭一个窗口呢?谢谢!
我在 FF 控制台中运行以下 javascript。它适用于 IE 和 Chrome。
win=window.open('','_self');
win.close();------undefined