How to detect IE7 and IE8 using jQuery.support

前端 未结 12 1239
忘掉有多难
忘掉有多难 2020-12-08 10:46

How can I detect IE 7 and IE 8 using jQuery.support properties?

Is it possible to detect the browser versions using jQuery.support or just those blah blah blah brows

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 11:03

    I've noticed many different ways of doing this, this DOESN'T use $.support although I've found that this works very well. Also just as a note, jquery has just announced that they will be removing any support for IE 6,7,8 in jquery 2.0 (http://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond/).

    var msVersion = navigator.userAgent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/),
          msie = !!msVersion,
          ie6 = msie && parseFloat(msVersion[1]) < 7;
    
      // Help prevent flashes of unstyled content
      if (!ie6) {
        //Do Something here.
      }
    

    Happy coding!

提交回复
热议问题