Home >Web Front-end >JS Tutorial >jquery plugin recommends browser sniffing userAgent_jquery
Comprehensive overview
In version 1.7.x, jQuery has removed support for browser sniffing. It is recommended to use feature detection. However, in actual projects, this function is more or less needed.
Compatibility
IE6, Chrome, Firefox, Safari, Opera
Framework dependencies
Native JS support
Module Support
Support AMD, node and browser
Usage introduction
1. Recognition engine, examples are as follows:
//If the browser is webkit core, execute the following code
if(!!client.engine.webkit){
//todo
}
2. Identify the browser, for example:
//If it is IE browser and the version of IE is 6, execute the following code
if(!!client.browser.ie && client.browser.ie == 6){
//todo
}
3. The identification and examples of operating systems are as follows:
//If it is a win7 system, execute the following code
if(!!client.system.win && client.system.win == 7){
//todo
}
Download link
https://github.com/hehongwei44/userAgent
Authorization information
Authorization type: MIT
Authorization type information: https://github.com/hehongwei44/userAgent/blob/master/LICENSE
Change Log
https://github.com/hehongwei44/userAgent/blob/master/ChangeLog.md
Other supplements
A very good plug-in, worth recommending