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>



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章