jQuery的是$ .browser德precated? [英] Is jQuery $.browser Deprecated?

查看:93
本文介绍了jQuery的是$ .browser德precated?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,如果我相信jQuery的$ .browser是/已经去precated是正确的?

Can someone tell me if I am correct in believing that jQuery's $.browser is/has been deprecated?

我现有的实现继续工作?如果没有,是否有一个易于实现的选择。

Will my existing implementations continue to work? If not, is there an easy to implement alternative.

推荐答案

文档:

在$ .browser属性是在jQuery的1.3,其功能pcated德$ P $可能会在未来的jQuery发布移动到一个团队支持的插件。

The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

所以,是的,这是德precated,但现有的实现将继续工作。如果功能被移除,它可能会方便使用的插件。

So, yes, it is deprecated, but your existing implementations will continue to work. If the functionality is removed, it will likely be easily accessible using a plugin.

至于是否还存在另一种...答案是是的,大概。这是远远更好地使用 $做特征检测。支持 而不是浏览器检测:检测实际功能需要,不能提供它的浏览器。与检测,从浏览器有所不同的浏览器最重要的特点。

As to whether there is an alternative... The answer is "yes, probably". It is far, far better to do feature detection using $.support rather than browser detection: detect the actual feature you need, not the browser that provides it. Most important features that vary from browser to browser are detected with that.

更新2013年2月16日:在jQuery的1.9,这个功能被删除(文档 )。这是迄今为止最好不要使用它。如果你真的,真的必须的使用它的功能,你可以用它恢复 jQuery的迁移插件。

Update 16 February 2013: In jQuery 1.9, this feature was removed (docs). It is far better not to use it. If you really, really must use its functionality, you can restore it with the jQuery Migrate plugin.

这篇关于jQuery的是$ .browser德precated?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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