javascript is the primary language for front-end development, and we can write JavaScript programs to determine the type and version of the browser. JavaScript can determine browser types in general there are two ways, one is based on a variety of
UserAgent and device, UserAgent Device
When a browser requests a webpage, A useragent (User Agent) is added before the url ).
PS: As a browser, you can do a lot of work on this useragent string. It can create many bugs or reduce many bugs. The
Whether in php or js, userAgent can return some information about the browser. Below I have sorted out some methods to use js to obtain the userAgent string to judge the browser and version.
Mobile phone language version judgment
Use navigator.
1 #This lwp::useragent is generally used in conjunction with other modules2 #比如:3 #HTTP:: Request4 #HTTP:: Cookies5 #HTTP:: Respose6 #HTTP:: Status7 #LWP:: useragent equivalent to creating a mock browser8 9 #用以下方式创一个浏览器Ten my $useragent=
JavaScript is the primary language for front-end development, and we can write JavaScript programs to determine the type and version of the browser. JavaScript can determine browser types in general there are two ways, one is based on a variety of
About navigator with useragent note 1.Navigator notes The Navigator object mainly contains some information about the client browser, the Navigator object is created automatically by the JavaScript runtime engine, but there is currently no public
Description: The Chinese name of the User Agent is the User Agent (UA). It is a special string header, the server can identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language, and browser
The judgment of mobile language version
Use Navigator.browserlanguage to get the Windows Phone language version, of course, the hateful Small mobile language version also has compatibility differences, compatible with Mozilla, and AppleWebKit
Meaning of User Agent
The Chinese name of the user agent is the user agent (UA), which is a special string header, the server can identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language,
I just saw an article in garden about UserAgent. I found this article and found it interesting. I sent it to the homepage for New Year's entertainment!
Google Chrome is a hot topic. Only professional users will notice the "Mozilla/5.0 (Windows;
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.