jQuery.browser (alias $.browser) was a plain object of flags read from navigator.userAgent — browser class booleans plus $.browser.version for the rendering engine (added in jQuery 1.0 / 1.1.3).
Syntax
Start with these common calls. Keep them short and readable.
Print. Log name : value for msie/mozilla/webkit/opera/version.
Example 2 — Official: msie and version
Check Internet Explorer and read the engine version string.
jQuery
console.log($.browser.msie); // true only on old IE UA
console.log($.browser.version); // engine version string
if ($.browser.msie) {
console.log("IE engine: " + $.browser.version);
}
This is WebKit!
(or “Not WebKit” on non-WebKit UAs)
How It Works
Flag since 1.4.webkit replaced older Safari-centric sniffing.
Branch. True when the UA reports a WebKit engine family.
Message. Print a short status for debugging legacy code.
Frequently Asked Questions
jQuery.browser was a plain object of Boolean flags parsed from navigator.userAgent — msie, mozilla, webkit, opera, and the deprecated safari flag. jQuery.browser.version held the rendering engine version string. Added in jQuery 1.0.
No in stock jQuery 1.9+. It was deprecated in 1.3 and removed in 1.9. jQuery 3.x does not include $.browser unless you load the jQuery Migrate plugin, which restores it for legacy code.
User-agent sniffing is unreliable — strings can be spoofed, compatibility modes lie, and new browsers break if/else chains. jQuery recommends feature detection instead of browser names.
A string reporting the rendering engine version from the user agent (for example Gecko for Firefox). It was removed with $.browser in 1.9 and has the same spoofing problems as the flags.
$.browser guessed the browser from the user-agent string. $.support ran feature tests for DOM/CSS quirks. Prefer feature detection for new code; treat both as legacy APIs when reading old tutorials.
Detect capabilities: CSS.supports() for CSS, "fetch" in window for APIs, and progressive enhancement. Use jQuery Migrate only while rewriting old plugins that still sniff $.browser.