浏览器版本判断

来源:互联网 发布:wordpress 数据库搬家 编辑:程序博客网 时间:2024/06/03 20:18

IE 11 - IE 6:
"mozilla/5.0 (windows nt 6.1; wow64; trident/7.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; .net clr 1.1.4322; .net4.0c; .net4.0e; rv:11.0) like gecko"
"mozilla/5.0 (compatible; msie 10.0; windows nt 6.2; trident/6.0)"
"mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; trident/5.0)"
"mozilla/4.0 (compatible; msie 8.0; windows nt 6.1; trident/4.0)"
"mozilla/4.0 (compatible; msie 7.0; windows nt 6.0)"
"mozilla/4.0 (compatible; msie 6.0; windows nt 5.1)"


$$.browser = function (a) {    var b = /opera/.test(a), c = /chrome/.test(a), d = /webkit/.test(a), g = !c && /safari/.test(a), f = !b && /msie/.test(a), j = f && /msie 7/.test(a), p = f && /msie 8/.test(a), k = f && /msie 9/.test(a), h = f && /msie 6/.test(a), m = !d && /gecko/.test(a), q = m && /rv:1\.8/.test(a);    m && /rv:1\.9/.test(a);    return {        IE: f, IE6: h, IE7: j, IE8: p, IE9: k, Moz: m, FF2: q, Opera: b, Safari: g, WebKit: d, Chrome: c    }}


navigator.userAgent.toLowerCase()


0 0