js:关闭当前页面

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

  

posted @ 2016-10-25 09:55  lhy031  阅读(513)  评论(0编辑  收藏  举报