JS Gets the current browser type

Source: Internet
Author: User

<script type= "Text/javascript" >

function Isie () {
Return Navigator.appName.indexOf ("Microsoft Internet Explorer")!=-1 && document.all;
}

function IsIE6 () {
return Navigator.userAgent.split (";") [1].tolowercase (). IndexOf ("msie 6.0″) = =" -1″?false:true;
}

function IsIE7 () {
return Navigator.userAgent.split (";") [1].tolowercase (). IndexOf ("msie 7.0″) = =" -1″?false:true;
}

function IsIE8 () {
return Navigator.userAgent.split (";") [1].tolowercase (). IndexOf ("msie 8.0″) = =" -1″?false:true;
}

function Isnn () {
Return navigator.userAgent.indexOf ("Netscape")!=-1;
}

function Isopera () {
Return navigator.appName.indexOf ("Opera")!=-1;
}

function IsFF () {
Return navigator.userAgent.indexOf ("Firefox")!=-1;
}

function Ischrome () {
Return navigator.userAgent.indexOf ("Chrome") >-1;
}
</script>

Below is the introduction of the next JS get client browser information

The Navigator object contains information about the browser. JS is to get the client browser information through the properties of Navigator
Navigator Object Properties:

Property
Describe

appCodeName returns the code name of the browser.
appMinorVersion returns the secondary version of the browser.
AppName returns the name of the browser.
AppVersion returns the platform and version information for the browser.
Browserlanguage returns the language of the current browser.
Cookieenabled returns a Boolean value that indicates whether cookies are enabled in the browser.
Cpuclass returns the CPU level of the browser system.
OnLine returns a Boolean value that indicates whether the system is in offline mode.
Platform returns the operating system platform running the browser.
Systemlanguage returns the default language used by the OS.
UserAgent returns the value of the user-agent header of the server sent by the client.
Userlanguage returns the natural language setting of the OS.

JS Gets the current browser type

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.