Name

appVersion — NN 2 IE 3 DOM n/a

Synopsis

Read-only

Reveals the version number of the browser, along with minimal operating system platform information (a subset of the information returned by userAgent). The first word of the value returned by Navigator includes the version number down to the x.xx level, whereas Internet Explorer goes only to the x.x level. In parentheses, both browsers include operating system information and (for Navigator) the browser’s default language version. Sample returned values are as follows:

Navigator:

4.04 [en] (Win95; I)
4.03 (Macintosh; I; PPC)

Internet Explorer:

4.0 (compatible; MSIE 4.01; Windows 95)
4.0 (compatible; MSIE 4.0; Macintosh; I; PPC)

You can use parseInt( ) on this value to determine whether a browser is of a particular generation, as shown in the following example. This extracts the integer value, which can be used in a math comparison operation to find out whether the browser is at a minimum needed version level for a script to run.

Example

var isVer4Min = parseInt(navigator.appVersion) >= 4

Value

String values.

Default

Depends on browser.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.