window.close() 兼容(未深度测试)

function closeWindow() {
var browserName = navigator.appName;
if(browserName == 'Netscape') {
var opened = window.open('about:blank','_self');
opened.opener = null;
opened.close();
} else {
window.opener = null;
window.open('','_self');
top.close() || window.close()
}
}

posted @ 2022-06-21 10:32  mrt_yy  阅读(59)  评论(0编辑  收藏  举报