1. Determine whether the browser is IE
Document. All? 'Ie': 'others ': the document. All value in IE is 1, and the value in other browsers is 0;
Navigator. useragent. indexof ("MSIE")> 0? 'Ie': 'others ': navigator. useragent indicates the user agent information.
Navigator. appname. indexof ("Microsoft ")! =-1? 'Ie': 'others ': navigator. appname indicates the browser name.
2. Determine the IE version
Navigator. appversion. Match (/6./I) = "6 ."? 'Ie6': 'Other version': This method can be used to determine whether IE6 is an Internet Explorer;
Navigator. useragent. indexof ("MSIE 6.0")> 0? 'Ie7': 'Other version': Same as above;
Navigator. appversion. Match (/7./I) = "7 ."? 'Ie7': 'Other version': This method can be used to determine whether IE7 is a known Internet Explorer;
Navigator. useragent. indexof ("MSIE 7.0")> 0? 'Ie7': 'Other version': Same as above;
Navigator. appversion. Match (/8./I) = "8 ."? 'Ie8': 'Other version': This method can be used to determine whether the Internet Explorer is IE8;
Navigator. useragent. indexof ("MSIE 8.0")> 0? 'Ie8': 'Other version': Same as above.
3. js obtains browser Information
Browser code name: navigator. appcodename
Browser name: navigator. appname
Browser version: navigator. appversion
Java support: navigator. javaenabled ()
Mime Type (array): navigator. mimetypes
System Platform: navigator. Platform
Plug-in (array): navigator. plugins
User Agent: navigator. useragent
[General] determines the browser type and version