To determine the browser's JS code _ Basic Knowledge

Source: Internet
Author: User

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title>js judgment Browser </title> </pead> <body> <pr> <!--determine visitor's browser (type) and Version--> <script type= "Text/javascript" > var browser=navigator.appname var b_version=navigator.appversion var v Ersion=parsefloat (b_version) document.write ("Browser name:" + Browser) document.write ("") document.write ("Browser ver Sion: "+ version" </script> <pr> <!--more about visitor browser (more information)--> <script type= "Text/javascript" > Do Cument.write ("<p>browser:") document.write (navigator.appname + "</p>") document.write ("<p> Browserversion: ") document.write (navigator.appversion +" </p> ") document.write (" <p>code: ") Document.wri Te (navigator.appcodename + "</p>") document.write ("<p>platform:") document.write (Navigator.platform + "& Lt;/p> ") document.write (" <p>cookies Enabled: ") document.write (navigator.cookieenabled + "</p>") document.write ("<p>browser ' s user Agent header:") document.write (Naviga Tor.useragent + "</p>") </script> <pr> <!--all information--> <script type= "Text/javascript" > VA R x = Navigator document.write ("codename=" + x.appcodename) document.write ("") document.write ("minorversion=" + X.appM inorversion) document.write ("") document.write ("name=" + x.appname) document.write ("") document.write ("Version=" + X . appversion) document.write ("") document.write ("cookieenabled=" + x.cookieenabled) document.write ("") document.write ("cpuclass=" + x.cpuclass) document.write ("") document.write ("online=" + x.online) document.write ("") document.write ("platform=" + x.platform) document.write ("") document.write ("ua=" + x.useragent) document.write ("") document.write ( "browserlanguage=" + x.browserlanguage) document.write ("") document.write ("systemlanguage=" + x.systemLanguage) docum Ent.write ("") DOCUMENT.WRite ("userlanguage=" + x.userlanguage) </script> <pr> <!--prompts users according to browser--> <script type= "Text/javas Cript "> var browser=navigator.appname var b_version=navigator.appversion var version=parsefloat (b_version) if (bro wser== "Netscape" | | browser== "Microsoft Internet Explorer" && (version>=4)) {document.write ("Your browser is good enough!") else {document.write ("It ' s time to upgrade your browser!") } </script> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

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.