var userAgent = navigator.userAgent,
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
rFirefox = /(firefox)\/([\w.]+)/,
rOpera = /(opera).+version\/([\w.]+)/,
rChrome = /(chrome)\/([\w.]+)/,
rSafari = /version\/([\w.]+).*(safari)/
var browser
var version
var ua = userAgent.toLowerCase()
function uaMatch(ua) {
var match = rMsie.exec(ua)
if (match != null) {
return { browser : "IE", version : match[2] || "0" }
}
var match = rFirefox.exec(ua)
if (match != null) {
return { browser : match[1] || "", version : match[2] || "0" }
}
var match = rOpera.exec(ua)
if (match != null) {
return { browser : match[1] || "", version : match[2] || "0" }
}
var match = rChrome.exec(ua)
if (match != null) {
return { browser : match[1] || "", version : match[2] || "0" }
}
var match = rSafari.exec(ua)
if (match != null) {
return { browser : match[2] || "", version : match[1] || "0" }
}
if (match != null) {
return { browser : "", version : "0" }
}
}
var browserMatch = uaMatch(userAgent.toLowerCase())
if (browserMatch.browser) {
browser = browserMatch.browser
version = browserMatch.version
}
document.write(browser+version)
</script>
isIE11 = (sUserAgent.toLowerCase().indexOf("trident") >-1 &&sUserAgent.indexOf("rv") >-1)一般电脑上的浏览器是IE11,
第一,系统一定不是xp系统,xp系统最高的IE版本是IE8;
第二,系统一般是win7系统以上;
第三,打开IE浏览器,点击设置选项栏,然后选择,如下图所示
点击之后如上图所示红色标识那里,最后会弹出如下图所示
这样显示的就是IE11;