分享给大家
function getBrowserType() {
var browserType = "";
if (navigator.userAgent.indexOf("MSIE") > 0) {
var isIE = function(ver) {
var b = document.createElement('b');
b.innerHTML = '<!--[if IE ' + ver + ']><i></i><![endif]-->'
return b.getElementsByTagName('i').length === 1;
};
if (isIE(9) == true) {
browserType = "IE9";
openBrowserInfo();
} else if (isIE(8) == true) {
browserType = "IE8";
openBrowserInfo();
} else if (isIE(7) == true) {
browserType = "IE7";