1.各种浏览器类型的判断
var cb = "Unknown";
if(window.ActiveXObject){
cb = "IE";
}else if(navigator.userAgent.toLowerCase().indexOf("firefox") != -1){
cb = "Firefox";
}else if((typeof document.implementation != "undefined") && (typeof document.implementation.createDocument != "undefined") && (typeof HTMLDocument != "undefined")){
cb = "Mozilla";
}else if(navigator.userAgent.toLowerCase().indexOf("opera") != -1){
cb = "Opera";
}
alert("浏览器类型"+cb);
2.如果浏览器上ie6,则执行<script>标签里面的语句
<!--[if IE 6]>
<script>
//要做出的反应
alert("hahah");
</script>
<![endif]-->