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.
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.
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.
所以,是的,它已被弃用,但您现有的实现将继续工作.如果删除了该功能,则可以使用插件轻松访问该功能.
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.
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.