【问题标题】:Getting "Scripts may close only the windows that were opened by it" error出现“脚本可能只关闭它打开的窗口”错误
【发布时间】:2015-05-27 13:06:41
【问题描述】:

我从另一个页面打开了一个窗口。单击按钮时,我想关闭此窗口。但是,浏览器抱怨“脚本可能只关闭它打开的窗口”。

我试过了:

window.open('', '_parent', '');
window.close();

但它不起作用。 请帮忙。

【问题讨论】:

标签: jquery window


【解决方案1】:

下面的代码对我有用

window.open('location of current page', '_self', '');
window.close();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-14
    • 1970-01-01
    • 1970-01-01
    • 2014-07-20
    • 1970-01-01
    • 1970-01-01
    • 2019-06-21
    相关资源
    最近更新 更多