function closewin(){
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") !=-1) {
window.location.href="about:blank";
window.close();
} else {
window.opener = null;
window.open("", "_self");
window.close();
}
}
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") !=-1) {
window.location.href="about:blank";
window.close();
} else {
window.opener = null;
window.open("", "_self");
window.close();
}
}
本文介绍了一种跨浏览器兼容的JavaScript方法,用于安全地关闭当前窗口。针对Firefox和Chrome等现代浏览器,以及其它类型的浏览器提供了不同的实现策略。
569

被折叠的 条评论
为什么被折叠?



