jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support 。
下面是根据navigator.userAgent.toLowerCase()方法请求浏览器信息头判断浏览器类型的方法:
var broswer = {
userCase: navigator.userAgent.toLowerCase(),
isMozilla : function(){
return /firefox/.test(userCase);
},
isWebkit: function(){
return /webkit/.test(userCase);
},
isOpera: function(){
return /opera/.test(userCase);
},
isMsie : function(){
return /msie/.test(userCase);
},
isIe6: function(){
return ‘undefined‘ == typeof(document.body.style.maxHeight);
},
isIE6_8: function(){
return !$.support.leadingWhitespace;
},
isIe7: function(){
return this.isMsie && $.browser.version < 8 ? true : false;
}
}
浏览器判断 —— jQuery 1.9不支持$.browser 判断浏览器类型和版本
原文:http://www.cnblogs.com/quietdinner/p/5207608.html