Deprecated in jQuery 1.3 (see jQuery.support) Contains flags for the useragent, read from navigator.userAgent.
Available flags are:
- safari
- opera
- msie
- mozilla
This property is available before the DOM is ready, therefore you can use it to add ready events only for certain browsers.
There are situations where object detection is not reliable enough, in such cases it makes sense to use browser detection.
A combination of browser and object detection yields quite reliable results.
Alerts "Do stuff for firefox 3" only for firefox 3 browsers.
jQuery.each(jQuery.browser, function(i, val) {
if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.9")
alert("Do stuff for firefox 3")
});
Set a CSS property to specific browser.
jQuery.each(jQuery.browser, function(i) {
if($.browser.msie){
$("#div ul li").css("display","inline");
}else{
$("#div ul li").css("display","inline-table");
}
});
