The user agent string userAgent can implement four identification functions: String useragent
Definition
User proxy string: navigator. userAgent
The HTTP specification clearly stipulates that the browser should send a brief user proxy string,
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
There are two methods for JavaScript to determine the browser type. One is to distinguish the browser type based on its unique attributes, the other method is to analyze the browser's userAgent attributes to determine that JavaScript is the main
The previous article "Web development compatibility series (I): useragent values for browsers of different devices" lists the useragent values of common computer browsers and smart phone browsers.
Here, we analyze the features of the browser's
This article mainly introduces the example of php useragent version detection. For more information, see
The code is as follows:
Define ('ie', 1 );
Define ('Firefox ', 2 );
Define ('chromi', 3 );
Define ('Opera ', 4 );
Class
This article mainly introduces the PHP detection useragent version of the example, the need for friends can refer to the following Code as follows: <?php define (' IE ', 1); Define (' FIREFOX ', 2); Define (' CHROME ', 3); Define (' OPERA ',
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.
JavaScript is the main language for front-end development. We can compile JavaScript programs to determine the browser type and version. There are two methods to determine the browser type in JavaScript: one is to distinguish based on the unique
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
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.