English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The JavaScript Navigator object is used for browser detection.
It can be used to obtain browser information, such as appName, appCodeName, userAgent, and so on.
The Navigator object iswindow (Window)Part of an object that can be written without a window prefix.
The following table lists the properties of the Navigator object:
Properties | Description |
---|---|
appCodeName | Returns the code name of the browser |
appName | Returns the name of the browser |
appVersion | Returns the version information of the browser |
cookieEnabled | Determines if cookies are enabled in the browser |
geolocation | Returns a Geolocation object that can be used to locate the user's location |
language | Returns the language of the browser |
onLine | Determines if the browser is online |
platform | Returns the platform for which the browser is compiled |
product | Returns the name of the browser engine |
userAgent | Returns the user agent header sent by the browser to the server |
The following table lists the methods of the Navigator object:
Method | Description |
---|---|
javaEnabled() | Check if Java is enabled |
taintEnabled() | Check if pollution is enabled.Since JavaScript 1.2Not recommended to use |