Name

Navigator — information about the browser in use

Availability

JavaScript 1.0; enhanced in JavaScript 1.1 and 1.2

Synopsis

navigator

Properties

appCodeName

A read-only string that specifies the code name of the browser. In all Netscape browsers, this is “Mozilla”. For compatibility, this property is “Mozilla” in Microsoft browsers as well.

appName

A read-only string property that specifies the name of the browser. For Netscape, the value of this property is “Netscape”. In IE, the value of this property is “Microsoft Internet Explorer”.

appVersion

A read-only string that specifies version and platform information for the browser. The first part of this string is a version number. Pass the string to parseInt( ) to obtain only the major version number or to parseFloat( ) to obtain the major and minor version numbers as a floating-point value. The remainder of the string value of this property provides other details about the browser version, including the operating system it is running on. Unfortunately, however, the format of this information varies widely from browser to browser.

cookieEnabled[IE 4, Netscape6]

A read-only boolean that is true if the browser has cookies enabled and false if they are disabled.

language [Netscape 4]

A read-only string that specifies the default language of the browser version. The value of this property is either a standard two-letter language code, such as “en” for English or “fr” for French, or a five-letter string that indicates a language ...

Get JavaScript: The Definitive Guide, Fourth Edition 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.