Home >Web Front-end >JS Tutorial >jquery plugin recommends browser sniffing userAgent_jquery

jquery plugin recommends browser sniffing userAgent_jquery

WBOY
WBOYOriginal
2016-05-16 16:31:401417browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn