JavaScript » Objects » Navigator

The Navigator object is designed to contain information about the version of Netscape Navigator which is being used. However, it can also be used with Internet Explorer. All of its properties, which are read-only, contain information about different aspects of the browser.



Syntax: navigator.appCodeName

This property contains a string which specifies the code name of the browser.


Syntax: navigator.appName

This property is a string that specifies the name of the browser. With a Netscape browser this property contains the string "Netscape", while with an IE explorer it contains "Microsoft Internet Explorer".


Syntax: navigator.appVersion

This property contains information about the browser version being used. If it is a Netscape browser, it contains the release number, the language used, the platform on which the browser is running, and either the letter I to indicate the international release, or the letter U for the domestic US release which has stronger encryption. e.g., '4.5 [en] (WinNT; I)'. With IE, this property only contains information about the compatible version of Internet Explorer and the platform, such as: '4.0 (compatible; MSIE 4.01; Windows NT)'.


Syntax: navigator.language

This Property contains information, usually in the form of two letters, on the language translation of the browser.


Syntax: navigator.mimeTypes

This property is an array of all the MIME (Multipart Internet Mail Extension) types supported by the client.


Syntax: navigator.platform

This property contains a string indicating the machine type for which the browser was compiled. e.g., 'Win32' is a 32 bit Windows machine.


Syntax: navigator.plugins

This property is an array of all the plugins installed on the client. The plugin property also has its own method: plugins.refresh


Syntax: navigator.userAgent

This property contains a string representing the value of the user-agent header sent by the client to the server in the http protocol. This information consists of the code name and the version of the browser, and is used by the server to identify the client.



Syntax: navigator.javaEnabled()

This method tests whether or not Java is enabled returning true if it is and false if not.


Syntax: navigator.preference(prefName[, setValue])

This method allows a signed script to get and set certain Navigator preferences.


Syntax: navigator.taintEnabled()

This method determines whether or not data tainting is enabled returning true if it is, and false if not.

See Also: