62,267
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
function closeWindow() {
var appName = navigator.appName;
if (appName == "Microsoft Internet Explorer") {
window.close();
}
else {
//window.opener = null;
window.open(window.location.href, "_self",'');
window.close();
}
//在 chrome 、IE 没问题 ,在FF中无效,难道必须手动修改FF配置??
}
</script>
学习了
[Quote=引用 4 楼 的回复:] <script type="text/javascript">
function CloseWebPage() {
if (navigator.userAgent.indexOf("MSIE") > 0) {
if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
window.opener = null; window.close();
}
else {
window.open('', '_top'); window.top.close();
}
}
else if (navigator.userAgent.indexOf("Firefox") > 0) {
window.location.href = 'about:blank ';
//window.history.go(-2);
}
else {
window.opener = null;
window.open('', '_self', '');
window.close();
}
}
</script>