JavaScript retrieves information icons of various browsers, and javascript retrieves icons

Source: Internet
Author: User

JavaScript retrieves information icons of various browsers, and javascript retrieves icons

How to obtain browser Information

Window has a navigator object to let us know all the information about the browser. We can use a series of API functions to know the information about the browser.

The JavaScript code is as follows:
Copy codeThe Code is as follows: function message () {txt = "<p> browser code name:" + navigator. appCodeName + "</p>"; txt + = "<p> browser name:" + navigator. appName + "</p>"; txt + = "<p> browser platform and version:" + navigator. appVersion + "</p>"; txt + = "<p> whether to enable cookie:" + navigator. cookieEnabled + "</p>"; txt + = "<p> operating system platform:" + navigator. platform + "</p>"; txt + = "<p> User-agent header value:" + navigator. userAgent + "</p>"; document. getElementById ("example "). innerHTML = txt ; If (navigator. appName = "Netscape" | navigator. appName = "Microsoft Internet Explorer") & (parseFloat (navigator. appVersion)> = 4) {alert ("your browser is advanced! ");} Else {alert (" it's time to upgrade your browser! ");}}

We can use this function to notify the user browser whether to update the browser, and also to help the user know the browser information.

Basic information of various browsers

The author tested almost mainstream browsers. Of course, no matter how many browsers are Trident, Blink, Gecko, and Webkit browsers, there will not be too many differences in resolution. The relevant information is attached as follows:

This is an Edge


IE11, the landlord does not use IE6, but there should not be too many discrepancies


Safari, the main author is the Windows system Safari version is relatively low


Sogou browser, once the landlord is also infatuated with it for a while!


The QQ browser (version) is quite powerful. Now, in addition to the most popular Chrome browsers, dual-core Trident and Blink, the main website is very fast under the Chrome kernel.


360 security browser compatibility mode, using the Trident kernel of IE


Firefox, not much to mention. Netscape is a genuine version and a necessary browser for developers.


Chrome. Currently, Google is the most popular browser.


360 secure browser speed mode, Chrome kernel, fast

Code Result Analysis

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.