浏览器检测的JQuery 2.0及更高版本 [英] Browser detection in JQuery 2.0 and higher

查看:197
本文介绍了浏览器检测的JQuery 2.0及更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

浏览器检测是一个code气味。不过,也有要检测/识别,而不是功能/支持检测用户使用浏览器的时间。你怎么做浏览器检测的JQuery 2.0及更高版本?

Browser detection is a code smell. However, there are times you want to detect/identify the browser a user is using as opposed to feature/support-detection. How do you do browser detection in JQuery 2.0 and higher?

推荐答案

您不使用jQuery做,因为它不是库的功能了。

You don't do it with jQuery, because it's not a feature of the library anymore.

所以,你与其他图书馆,或自己做。关于浏览器检测和JavaScript code中的所有细节都在怪异模式

So you do it with another library, or yourself. All the details about browser detection and the javascript code are at Quirksmode.

但就是不去做,真的。什么是您的使用情况?

But just don't do it, really. What's your use case?

这篇关于浏览器检测的JQuery 2.0及更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆