IE chrome兼容问题

时间:2024-04-04 22:34:28

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>