IE chrome兼容问题

1、关于display显示和隐藏问题

 

document.getElementById("id").style.display="";//表示显示
document.getElementById("id").style.display="none";//表示隐藏


 


2、js调用关闭事件

 

<script language="javascript">
function closeCurrWindow(){
	var browserName=navigator.appName;
	alert(browserName);
	if (browserName=="Netscape") {
		window.open('','_self','');
		window.close(); 
	} else if (browserName=="Microsoft Internet Explorer") {
				window.opener = "whoCares";
				window.opener = null;    //Close window, not hint. for IE6, IE7
				window.open('','_top'); //Close window, not hint. for IE7
				window.close();
			}
}
</script>


 


 

posted on 2013-12-05 09:14  我的小人生  阅读(358)  评论(0编辑  收藏  举报