Window.navigator

  • Revision slug: DOM/window.navigator
  • Revision title: window.navigator
  • Revision id: 15535
  • Created:
  • Creator: Dria
  • Is current revision? No
  • Comment

Revision Content

{{template.DomRef()}}

Summary

Returns a reference to the navigator object.

Syntax

nav = window.navigator 

Parameters

  • nav is a navigator object reference.

Example

nav = window.navigator; 
if ( nav.language != en ) { 
   res = window.confirm(lang_warn); 
}

Notes

The navigator object is used to examine the actual browser being used. It includes properties for getting information about the browser itself. All of the properties and methods available from window.navigator can also be referenced simply with navigator.

Properties

navigator.appCodeName 
Returns the internal "code" name of the current browser.
navigator.appName 
Returns the official name of the browser.
navigator.appVersion 
Returns the version of the browser as a string.
navigator.cookieEnabled 
Returns a boolean indicating whether cookies are enabled in the browser or not.
navigator.language 
Returns a string representing the language version of the browser.
navigator.mimeTypes 
Returns a list of the MIME types supported by the browser.
navigator.oscpu 
Returns a string that represents the current operating system.
navigator.platform 
Returns a string representing the platform of the browser.
navigator.plugins 
Returns an array of the plugins installed in the browser.
navigator.product 
Returns the product name of the browser (e.g. "Gecko")
navigator.productSub 
Returns the product version number (e.g. "5.0")
navigator.userAgent 
Returns the user agent string for the current browser.
navigator.vendor 
Returns the vendor name of the current browser (e.g. "Netscape6")
navigator.vendorSub 
Returns the vendor version number (e.g. "6.1")

Specification

DOM Level 0. Not part of specification.

Revision Source

<p>
{{template.DomRef()}}
</p>
<h3 name="Summary">Summary</h3>
<p>Returns a reference to the navigator object. 
</p>
<h3 name="Syntax">Syntax </h3>
<pre class="eval">nav = window.navigator 
</pre>
<h3 name="Parameters">Parameters </h3>
<ul><li><code>nav</code> is a navigator object reference.
</li></ul>
<h3 name="Example">Example </h3>
<pre>nav = window.navigator; 
if ( nav.language != en ) { 
   res = window.confirm(lang_warn); 
}
</pre>
<h3 name="Notes">Notes </h3>
<p>The navigator object is used to examine the actual browser being used. It includes properties for getting information about the browser itself. 
All of the properties and methods available from window.navigator can also be referenced simply with navigator. 
</p>
<h3 name="Properties">Properties</h3>
<dl><dt> <a href="en/Navigator.appCodeName">navigator.appCodeName</a> </dt><dd> Returns the internal "code" name of the current browser.
</dd><dt> <a href="en/Navigator.appName">navigator.appName</a> </dt><dd> Returns the official name of the browser.
</dd><dt> <a href="en/Navigator.appVersion">navigator.appVersion</a> </dt><dd> Returns the version of the browser as a string.
</dd><dt> <a href="en/Navigator.cookieEnabled">navigator.cookieEnabled</a> </dt><dd> Returns a boolean indicating whether cookies are enabled in the browser or not.
</dd><dt> <a href="en/Navigator.language">navigator.language</a> </dt><dd> Returns a string representing the language version of the browser.
</dd><dt> <a href="en/Navigator.mimeTypes">navigator.mimeTypes</a> </dt><dd> Returns a list of the MIME types supported by the browser.
</dd><dt> <a href="en/Navigator.oscpu">navigator.oscpu</a> </dt><dd> Returns a string that represents the current operating system.
</dd><dt> <a href="en/Navigator.platform">navigator.platform</a> </dt><dd> Returns a string representing the platform of the browser.
</dd><dt> <a href="en/Navigator.plugins">navigator.plugins</a> </dt><dd> Returns an array of the plugins installed in the browser.
</dd><dt> <a href="en/Navigator.product">navigator.product</a> </dt><dd> Returns the product name of the browser (e.g. "Gecko")
</dd><dt> <a href="en/Navigator.productSub">navigator.productSub</a> </dt><dd> Returns the product version number (e.g. "5.0")
</dd><dt> <a href="en/Navigator.userAgent">navigator.userAgent</a> </dt><dd> Returns the user agent string for the current browser.
</dd><dt> <a href="en/Navigator.vendor">navigator.vendor</a> </dt><dd> Returns the vendor name of the current browser (e.g. "Netscape6")
</dd><dt> <a href="en/Navigator.vendorSub">navigator.vendorSub</a> </dt><dd> Returns the vendor version number (e.g. "6.1")
</dd></dl>
<h3 name="Specification">Specification </h3>
<p>DOM Level 0. Not part of specification.
</p>
Revert to this revision