Navigator
102
|
JavaScript Pocket Reference
Math.sin(x)
Returns the sine of x.
Math.sqrt(x)
Returns the square root of x. Returns NaN if x is less than zero.
Math.tan(x)
Returns the tangent of x.
See Also
Number
Navigator
information about the browser
Client-side JavaScript 1.0
Synopsis
navigator
Properties
appCodeName
A read-only string that specifies a nickname for 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 infor-
mation for the browser. The first part of this string is a
version number. Pass the string to
parseInt() to obtain the
major version number only 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 oper-
ating system it is running on. Unfortunately, however, the
format of this information varies widely from browser to
browser.
Navigator
JavaScript Pocket Reference
|
103
cookieEnabled
A read-only boolean that is true if the browser has cookies
enabled, and
false if they are disabled. IE 4, Netscape 6.
language
A read-only string that specifies the default language of the
browser version. The value of this property is a standard two-
letter language code such as “en” for English or “fr” for
French. It can also be a five-letter string indicating a language
and a regional variant, such as “fr_CA” for French, as spoken
in Canada. Netscape 4; note that IE 4 provides two different
language-related properties.
platform
A read-only string that specifies the operating system and/or
hardware platform the browser is running under. Although
there is not standard set of values for this property, some
typical values are “Win32”, “MacPPC”, and “Linux i586”. JS
1.2.
systemLanguage
A read-only string that specifies the default language of the
operating system using the same standard codes used by the
Netscape-specific
language property. IE 4.
userAgent
A read-only string that specifies the value the browser uses for
the user-agent header in HTTP requests. Typically, this is the
value of
navigator.appCodeName followed by a slash and the
value of
navigator.appVersion.
userLanguage
A read-only string that specifies the preferred language of the
user using the same standard codes used by the Netscape-
specific
language property. IE 4.
Methods
javaEnabled()
Returns true if Java is supported and enabled in the current
browser, or
false if it is not. JS 1.1.
See Also
Screen

Get JavaScript Pocket Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.