Detect Internet Explorer 6 or below in jQuery

前端 未结 13 2462
野的像风
野的像风 2020-12-12 17:44

I\'m new to jquery and was wondering: is a simple way to detect whether a browser is Internet Explorer 6 or below?

13条回答
  •  一生所求
    2020-12-12 18:30

    As simple as this:

    if($.browser.msie && $.browser.version=="6.0") alert("Im the annoying IE6");
    

    Update

    Please note that $.browser is removed from jQuery 1.9

    If you still need to use $.browser in jQuery 1.9 (or other deprecated functions), try jQuery-migrate (https://github.com/jquery/jquery-migrate/ - http://code.jquery.com/jquery-migrate-1.2.1.js)

提交回复
热议问题