网上关于IE9的信息比较少,我自己也想了些办法,结果不行。
通过取navigator.userAgent,来判断,结果有些IE9显示结果的是msie 9.0,有的IE9显示的结果是msie 7.0。
不知道该怎么办了,如果加上条件document.documentMode,可以排除IE7,但是IE8和IE9要怎么区别呢。
IE9里面有什么IE8不支持的东西吗?
请高手解答。
通过取navigator.userAgent,来判断,结果有些IE9显示结果的是msie 9.0,有的IE9显示的结果是msie 7.0。
不知道该怎么办了,如果加上条件document.documentMode,可以排除IE7,但是IE8和IE9要怎么区别呢。
IE9里面有什么IE8不支持的东西吗?
请高手解答。
<script type="text/javascript">
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)
Sys.ie = ua.match(/msie ([\d.]+)/)[1]
else if (document.getBoxObjectFor)
Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1] if(Sys.ie) document.write('IE: '+Sys.ie);
if(Sys.firefox) document.write('Firefox: '+Sys.firefox);
</script>
如果你设置的是IE7
那么JS代码获取的肯定是7.0
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
後,ie7到ie9使用navigator.userAgent得出的都是ie7,那怎麼區分ie9呢???有其他辦法沒。。