Navigator Browser Object _ basics in JavaScript

Source: Internet
Author: User
Navigator Browser object that contains the version information for the navigator you are using. Reflects the information of the browser currently in use. The JavaScript client runtime engine automatically creates the Navigator object.
More detailed information can be found in the MSDN or Navigator 2.0 after the documentation, here we make a simple explanation
Include several major attributes:



appCodeName return to the browser's "code name" (?), popular IE and NN are returned to ' Mozilla '.
The following example shows the value of the appCodeName property:
document.write ("Navigator.appcodename value is" + navigator.appcodename)

AppName returns the browser name. IE returns to ' Microsoft Internet Explorer ', NN returns ' Netscape '.
The following example shows the value of the AppName property:
document.write ("Navigator.appname value is" + navigator.appname)

AppVersion back to the browser version, including large version number, small version number, language, operating platform and other information.

Language language

MimeType the supported MIME types in an array

Platform returns to the browser's operating platform and returns ' Win32 ' (the case may vary) for browsers on Windows 9x.

UserAgent returns all of the above information. For example, IE5.01 returns ' mozilla/4.0 (compatible; MSIE 5.01; Windows 98) '.

Plugins an installed add-in with an array

Javaenabled () returns a Boolean value that represents the current browser's permission not to allow Java.


Detects the version of the browser, the MIME type supported, and the installed add-in (plug-in). The object contains two child objects: A Plug-in object, a MIME type object.
For example:
<Script> with (document) {write ("Your browser information:<ol>"); Write ("<LI> code:" +navigator.appcodename); Write ("<LI> name:" +navigator.appname); Write ("<LI> version:" +navigator.appversion); Write ("<LI> language:" +navigator.language); Write ("<LI> compiler platform:" +navigator.platform); Write ("<LI> user header:" +navigator.useragent); } </Script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]


For example:
<Script> if (document.all) {document.write ("Your browser is: MSI E "); else {document.write ("Your browser is: Navigator"); } </Script>
[ctrl+a All selected note: If you need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.