兼容所有浏览器的关闭当前页面方法

单页面

function exitSystem()
{
    window.opener = null;
    window.open('', '_self', '');
    window.close();//以上三行可关闭单个页面
    window.open('', '_top');
    window.top.close();
    window.location.href = 'about:blank ';
    window.close();//上面两次关闭适用于FireFox等浏览器
}

含有多个frame的页面在子页面中参照该代码可以直接关闭

function exitSystem()//多个frame,某个frame内执行js
{
    parent.window.opener = null;
    parent.window.open('', '_self', '');
    parent.window.close();
    parent.window.open('', '_top');
    parent.window.top.close();
    parent.window.location.href = 'about:blank ';
    window.close();
}

亲测可用!
(免费FQ软件http://miaoaff.com/reg.php?id=7568852)

posted @ 2018-07-19 09:36  HumorChen99  阅读(642)  评论(0编辑  收藏  举报