YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

YAHOO Global  2.4.0

Yahoo! UI Library > yahoo > YAHOO.env.ua

Show Private Show Protected

static Class YAHOO.env.ua

Do not fork for a browser if it can be avoided. Use feature detection when you can. Use the user agent as a last resort. YAHOO.env.ua stores a version number for the browser engine, 0 otherwise. This value may or may not map to the version number of the browser using the engine. The value is presented as a float so that it can easily be used for boolean evaluation as well as for looking for a particular range of versions. Because of this, some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 reports 1.8).

Properties

gecko - float

Gecko engine revision number. Will evaluate to 1 if Gecko is detected but the revision could not be found. Other browsers will be 0. Example: 1.8
Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
Firefox 3 alpha: 1.9a4   <-- Reports 1.9

ie - float

Internet Explorer version number or 0. Example: 6

mobile - string

The mobile property will be set to a string containing any relevant user agent information when a modern mobile browser is detected. Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series devices with the WebKit-based browser, and Opera Mini.

opera - float

Opera version number or 0. Example: 9.2

webkit - float

AppleWebKit version. KHTML browsers that are not WebKit browsers will evaluate to 1, other browsers 0. Example: 418.9.1
Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
latest available for Mac OSX 10.3.
Safari 2.0.2:         416     <-- hasOwnProperty introduced
Safari 2.0.4:         418     <-- preventDefault fixed
Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
different versions of webkit
Safari 2.0.4 (419.3): 419     <-- Current Safari release
Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
be higher than this
http://developer.apple.com/internet/safari/uamatrix.html


Copyright © 2007 Yahoo! Inc. All rights reserved.