Home | Top | Website design | JavaScript Editor | ![]() | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Retrieves a string equivalent to the HTTP user-agent request header.
Syntax
[ sUserAgent = ] object.userAgentPossible Values
sUserAgent | String that specifies a valid HTTP user agent. |
The property is read-only. The property has no default value.
Remarks
The HTTP user-agent request header contains information about compatibility, the browser, and the platform name. For more information about the browser, see the appName property. For more information about the platform, see the appVersion property.
The userAgent property dynamically returns a different value depending on the browser and platform versions. For example, Microsoft® Internet Explorer 6 returns the following string for Microsoft Windows® XP. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Examples
This example uses the userAgent property to specify a required platform before additional script is executed. For example, if Windows XP is a requirement for the document, you can use a variable to determine whether the user is running the necessary operating system. The "bIsXP" variable is set to true if Windows XP is found in the userAgent value and the additional script is processed.
<SCRIPT>Standards Information
There is no public standard that applies to this property.
Applies To
|
clientInformation , navigator |
Home | Top | Website design | JavaScript Editor | ![]() | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |