-
Book Overview & Buying
-
Table Of Contents
jQuery 1.4 Reference Guide
These properties are associated with the global jQuery object. They allow us to retrieve information about the user agent (web browser) that is executing the script and its features.
Information about the user agent displaying the page.
The $.browser property allows us to detect which web browser 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, Safari, and Opera) as well as version information.
$.print($.browser);
{version: 1.9.1.3,safari: false,opera: false,msie: false,mozilla: true}
This property is available immediately. Therefore, it is safe to use it to determine whether to call $(document).ready() or not.
The $.browser property is deprecated in jQuery 1.3, but there are no immediate plans to remove it.
As $.browser uses navigator.useragent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself...
Change the font size
Change margin width
Change background colour