对浏览器版本的判断建议用是否支持某功能来判断,判断IE的版本一种方案是用navigator.userAgent判断,另外可以用下面的代码判断:
<script>
var isIE = false;
var version = -1;
</script>
<!--[if IE 6]>
<script>
isIE = true;
version = 6
</script>
<![endif]-->
<!--[if IE 7]>
<script>
isIE = true;
version = 7
</script>
<![endif]-->
<!--[if IE 8]>
<script>
isIE = true;
version = 8
</script>
<![endif]-->
<!--[if IE 9]>
<script>
isIE = true;
version = 9
</script>
<![endif]-->
还是不行啊
正常,本来就是这样的
应该就是这样的。
我这,IE8在兼容模式下UseAgent的MSIE是7.0,非兼容模式是8.0
ie 有兼容模式
< meta http-equiv = "X-UA-Compatible" content = "IE=edge"/>
设置这个试试,
http://www.cnblogs.com/Miton/archive/2011/04/28/2032041.html
顶上去,让高手解答
1, 设置页面的doctype
2, 修改IE浏览器的默认兼容性设置,去掉display intranet sites in compatibility view的勾