开发者

How do i use jquery to find out which browser client is using

开发者 https://www.devze.com 2023-02-02 18:35 出处:网络
Based on that i can add CSS feature to one element of my page. C开发者_StackOverflow中文版an anybody please give an example?You can use $.browser.However, this is highly discouraged, since it doesn\'t

Based on that i can add CSS feature to one element of my page. C开发者_StackOverflow中文版an anybody please give an example?


You can use $.browser. However, this is highly discouraged, since it doesn't cope with new or rare browsers. As the docs note:

We recommend against using this property; please try to use feature detection instead (see jQuery.support).

$.browser will be removed from future versions of jQuery.

If you give us more information, we may be able to suggest a better solution.

EDIT: As the docs say, you can use flags like $.browser.webkit (true for webkit) or $.browser.ie, and get the version from $.browser.version.


You can use the jQuery.browser or $.browser property. Check this URL: http://api.jquery.com/jQuery.browser/

0

精彩评论

暂无评论...
验证码 换一张
取 消