How do I detect IE 8 with jQuery?

前端 未结 12 1413
一生所求
一生所求 2020-11-30 19:14

I need to detect not only the browser type but version as well using jQuery. Mostly I need to find out if it is IE 8 or not.

I am not sure if I am doing it correctly

12条回答
  •  醉酒成梦
    2020-11-30 19:46

    It is documented in jQuery API Documentation. Check for Internet Explorer with $.browser.msie and then check its version with $.browser.version.

    UPDATE: $.browser removed in jQuery 1.9

    The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.

提交回复
热议问题