js IE关闭窗口

参考文章:
http://www.webdeveloper.com/forum/archive/index.php/t-121449.html
http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread/d77c1328-b29a-44b7-90ec-b78e3d32fa1a/#page:2
实现功能:关闭IE,不弹出提示信息
搜索关键字:IE7 close parent window without prompt
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">

  <SCRIPT LANGUAGE="JavaScript">
  <!--
	if (window.navigator.userAgent.indexOf('MSIE')<1){
		alert('本系统仅支持IE浏览器,请使用IE浏览器!');
	}else{
		var newWin = window.open('mainframe.jsp?date="+System.currentTimeMillis()+"','','width=252,height=500,resizable=1,status=0,location=0');
		var ua = window.navigator.appVersion; 
		var msie = ua.indexOf ( 'MSIE' );
		var version = ua.substring(msie+5,msie+6);
		if(version>='7'){
			window.open('closing.html','_self');
                        newWin.focus();
                        window.close();
		}else{
			window.opener = null;
			window.close();
		}
  };
  //-->
  </SCRIPT>
 </HEAD>

 <BODY>
  
 </BODY>
</HTML>


closing.html

<body onload="javascript:self.close();"></body>

你可能感兴趣的:(html,PHP,IE,Microsoft,Social)