判断IE版本

 1 var checkIEVersion = function(){
 2     var browser = navigator.appName;
 3     var b_version = navigator.appVersion;
 4     var version = b_version.split(";");
 5     var trim_Version = version[1].replace(/[ ]/g,"");
 6     if(browser == 'Microsoft Internet Explorer'){
 7         if(trim_Version == 'MSIE6.0'){
 8             return "IE6";
 9         }else if(trim_Version == 'MSIE7.0'){
10             return "IE7";
11         }else if(trim_Version == 'MSIE8.0'){
12             return "IE8";
13         }else if(trim_Version == 'MSIE9.0'){
14             return "IE9";
15         }else if(trim_Version == 'MSIE10.0'){
16             return "IE10";
17         }else if(trim_Version == 'WOW64'){
18             return "IE11";
19         }
20     }
21 }

 

posted @ 2020-12-09 13:43  傅丹辰cds  阅读(83)  评论(0编辑  收藏  举报