You are here: Reference > JavaScript > client-side > browser > objects > clientInformation

clientInformation object

Browser support:
Contains information about the browser and the operating system of the user.
For cross-browser functionality, use the navigator object instead.

Syntax:

Properties that reference the object:
window.clientInformation

Possible members:

Properties:
appCodeName
Retrieves the code name of the browser.
appMinorVersion
Returns the minor version of the browser.
appName
Returns the name of the browser.
appVersion
Returns the platform and version of the browser.
browserLanguage
Returns the language of the browser application or the operating system's user interface.
cookieEnabled
Retrieves a Boolean value that indicates whether cookies are enabled in the browser.
cpuClass
Returns the central processing unit (CPU) class of the user's operating system.
language
Returns the language of the browser application.
mimeTypes
Represents a collection of all supported MIME types.
onLine
Returns a Boolean value that indicates whether the browser is working online.
platform
Returns the name of the operating system platform.
plugins
Represents a collection of all installed plugins in the browser.
product
Returns a string that contains information about the browser engine.
productSub
Returns a string that contains information about the development build number of the browser engine.
systemLanguage
Returns the language edition of the operating system.
userAgent
Returns a string value that represents the user-agent header.
userLanguage
Returns the current Regional and Language settings of the operating system in Internet Explorer and the language of the browser application in Opera.
userProfile
9
Contains information about the current user's profile.
vendor
Returns a string that specifies the name of the browser vendor.
vendorSub
Returns a string that specifies the version number of the browser given by the vendor.
Methods:
javaEnabled
Returns a Boolean value that indicates whether Java is enabled in the current browser.
taintEnabled
Returns a Boolean value that indicates whether the data-tainting security model is enabled.

Example HTML code 1:

This example displays various information about the browser and the operating system of the user:
<head>
    <script type="text/javascript">
        function AddRowToInfo (description, value) {
            if (value !== undefined) {
                var infoTable = document.getElementById ("info");
                var row = infoTable.insertRow (-1);
                var cell = row.insertCell (-1);
                cell.innerHTML = description;
                cell.style.paddingRight = "10px";
                cell = row.insertCell (-1);
                cell.innerHTML = value;
                cell.style.paddingLeft = "10px";
            }
        }

        function GetVisitorInfo () {
            if (window.clientInformation) {
                AddRowToInfo ("Name of the browser (appName)", window.clientInformation.appName);
                AddRowToInfo ("Name of the browser vendor (vendor)", window.clientInformation.vendor);
                AddRowToInfo ("Code name of the browser (appCodeName)", window.clientInformation.appCodeName);
                AddRowToInfo ("Engine of the browser (product)", window.clientInformation.product);
                AddRowToInfo ("Build number of the browser engine (productSub)", window.clientInformation.productSub);
                if (window.opera) {
                    AddRowToInfo ("Build number of the browser (buildNumber)", window.opera.buildNumber ());
                    AddRowToInfo ("Version number of the browser (version)", window.opera.version ());
                }
                AddRowToInfo ("Version and platform of the browser (appVersion)", window.clientInformation.appVersion);
                AddRowToInfo ("Version of the browser given by the vendor (vendorSub)", window.clientInformation.vendorSub);
                AddRowToInfo ("Minor version of the browser (appMinorVersion)", window.clientInformation.appMinorVersion);
                AddRowToInfo ("Build identifier of the browser (buildID)", window.clientInformation.buildID);
                AddRowToInfo ("User-agent request header (userAgent)", window.clientInformation.userAgent);
                AddRowToInfo ("Language of the browser (language)", window.clientInformation.language);
                AddRowToInfo ("Cookies are enabled (cookieEnabled)", window.clientInformation.cookieEnabled);

                AddRowToInfo ("Operating system (platform)", window.clientInformation.platform);
                if (window.clientInformation.language === undefined) {  // in Opera, the language, browserLanguage and userLanguage properties are equivalent
                    AddRowToInfo ("Language of the operating system's user interface (browserLanguage)", window.clientInformation.browserLanguage);
                    AddRowToInfo ("Regional and Language settings of the operating system (userLanguage)", window.clientInformation.userLanguage);
                }
                AddRowToInfo ("Language of the installed operating system (systemLanguage)", window.clientInformation.systemLanguage);
                AddRowToInfo ("Class of CPU (cpuClass)", window.clientInformation.cpuClass);
                AddRowToInfo ("Information about the OS and CPU (oscpu)", window.clientInformation.oscpu);
                AddRowToInfo ("System is online (onLine)", window.clientInformation.onLine);
            }
            else {
                alert ("Your browser does not support the clientInformation object!");
            }
        }
    </script>
</head>
<body onload="GetVisitorInfo ();">
    <table id="info" cellpadding="0px" cellspacing="0px" border="1px" style="empty-cells:show;">
        <colgroup>
            <col style="background-color: #e0a0b0;" />
            <col />
        </colgroup>
        <tbody>
        </tbody>
    </table>
</body>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content