window.close(); 谷歌浏览器不好用的解决方案

方案一:
 var userAgent = navigator.userAgent;
if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
   window.location.href="about:blank";
} else {
   window.opener = null;
   window.open("", "_self");

   window.close(); 

将你要关闭的页面变成空白页  实属无奈之举

方案二:

window.open('url', '窗口ID(随便起)');

想用上面的方法 打开你想关闭的页面 然后window.close();就可以用了。

posted @ 2015-06-24 14:31  燕儿归  阅读(1400)  评论(0编辑  收藏  举报