Home >Web Front-end >JS Tutorial >JavaScript introductory tutorial (4) js browser object_basic knowledge

JavaScript introductory tutorial (4) js browser object_basic knowledge

WBOY
WBOYOriginal
2016-05-16 18:56:291099browse

For more detailed information, you can check msdn or the documentation after Navigator 2.0. Here we will make a simple explanation
including several major attributes:
appCodeName returns the browser's "code name" (?), popular Both IE and NN return 'Mozilla'.
The following example shows the value of the appCodeName attribute:
document.write("The value of navigator.appCodeName is " navigator.appCodeName)
appName returns the browser name. IE returns 'Microsoft Internet Explorer', NN returns 'Netscape'.
The following example shows the value of the appName attribute:
document.write("The value of navigator.appName is" navigator.appName)
appVersion returns the browser version, including major version number and minor version number , language, operating platform and other information.
language language
mimeType represents the supported MIME types as an array
platform returns the operating platform of the browser. For browsers on Windows 9x, returns 'Win32' (the case may be different).
userAgent returns all the above information. For example, IE5.01 returns 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)'.
plugins represents the installed plug-ins as an array
javaEnabled() returns a Boolean value, indicating that the current browser allows or disallows Java.
Detect the browser version, supported MIME types, and installed plug-ins. This object contains two sub-objects: plug-in object and MIME type object.
For example:


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

For example:

[Ctrl A select all Note:
If you need to introduce external Js, you need to refresh to execute <script> with (document) { write ("你的浏览器信息:<OL>"); write ("<LI>代码:"+navigator.appCodeName); write ("<LI>名称:"+navigator.appName); write ("<LI>版本:"+navigator.appVersion); write ("<LI>语言:"+navigator.language); write ("<LI>编译平台:"+navigator.platform); write ("<LI>用户表头:"+navigator.userAgent); } </script>]<script> if (document.all) { document.write("你的浏览器是:MSIE"); } else { document.write("你的浏览器是:Navigator"); } </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn