window.close()在FF下无效
JScript code
<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>
------解决方案--------------------<script>
window.opener=null;
window.open('','_self');
window.close();
</script>
果断试一下
------解决方案--------------------把前面的window.open(window.location.href, "_self",'');注释掉试一试。
------解决方案--------------------
我的解决方案http://blog.csdn.net/bdstjk/article/details/7473748
JScript code
<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>
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------