The jQuery Browser Plugin is an addon for jQuery that makes it easy to uniquely identify your visitors’ browsers.
It gives you an object in javascript that contains all of the information about the browser being used. It also adds CSS browser selectors, which means you can style elements or write functions for specific browsers, browser versions, layouts, layout versions, and even operating systems. Image of the jQuery Browser Plugin in action.
First, it quickly and carefully collects all of the information about the browser. Then, it takes all of that information and places it into intuitively named objects inside jQuery.browser, jQuery.layout, and jQuery.os. making browser information as easily accessible as jQuery already makes writing javascript.
jQuery is a small but power-packed bundle of javascript functions that make writing javascript quick and simple. Selecting elements on your page is like using CSS, learning and using functions requires minimal fuss, and the learning curve is sometimes described as “zero”.
Features
The jQuery Browser Plugin strives to make accessing your visitors’ browser information simple and intuitive. It can literally be this simple:
* browser.name: The name of the browser being used.
alert($.browser.name); // this will alert ‘firefox’
* browser.version: The version of the browser (note, as a string).
alert($.browser.version); // this will alert ‘3.5.3′
* browser.versionNumber: The version of the browser (note, as an integer).
alert($.browser.versionNumber); // this will alert ‘3.5′ alert($.browser.versionNumber + 1); // this will alert ‘4.5′
* browser.versionX: The release of the browser (think 2x, 3x, etc).
alert($.browser.versionX); // this will alert ‘3′
* browser.className: The browser name and browser version as a class name.
alert($.browser.className); // this will alert ‘firefox3′
* layout.name: The name of the layout engine being used.
alert($.layout.name); // this will alert ‘gecko’
* layout.version: The version of the layout engine (note, as a string).
alert($.layout.version); // this will alert ‘1.9.1.3′
* layout.versionNumber: The version of the layout engine (note, as an integer).
alert($.layout.versionNumber); // this will alert ‘1.9′ alert($.layout.versionNumber + 1); // this will alert ‘2.9′
* browser.versionX: The release of the layout engine (think 2x, 3x, etc).
alert($.layout.versionX); // this will alert ‘1′
* layout.className: The browser name and browser version as a class name.
alert($.layout.className); // this will alert ‘gecko1′
* os.name: The operating system being used.
alert($.os.name); // this will alert ‘win’
Other values that may appears (this is actually based off the browser you’re currently viewing this page with).
Demo: http://jquery.thewikies.com/browser/test.html
Download: http://jquery.thewikies.com/browser/jquery.browser.min.js
Source: http://jquery.thewikies.com/browser/

Related Listings:
RSS feed for comments on this post. TrackBack URL
October 6th, 2009 at 11:44 pm
[...] This post was mentioned on Twitter by Open4G Media and jQuery Tips. jQuery Tips said: jQuery Browser Plugin #jQuery http://bit.ly/QUhv4 [...]
October 26th, 2009 at 5:01 am
[...] jQuery Browser Plugin [...]