Learn all about the jQuery function jQuery.browser.
$.browser property provides information about the web browser that is accessing the page, as reported by the browser itself. It contains flags for each of the four most prevalent browser classes (Internet Explorer, Mozilla, Webkit, and Opera) as well as version information.
Available flags are:
- webkit (as of jQuery 1.4)
- safari (deprecated)
This property is available immediately. It is therefore safe to use it to determine whether or not to call
$.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.
navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on
$.browser it’s better to use libraries like Modernizr.