How to detect IE7 and IE8 using jQuery.support

前端 未结 12 1263
忘掉有多难
忘掉有多难 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:01

    as explained, .support is for feature-detection. if you want to detect the browser, just use .browser.

     var ua = $.browser;
     if ( ua.msie && ua.version.slice(0,1) == "8" ) {
       alert('IE 8');
     } else if ( ua.msie && ua.version.slice(0,1) == "7" ) {
       alert('IE 7');
     } else {
       alert('something else');
     }
    

提交回复
热议问题