How do I detect IE10 using javascript?

后端 未结 6 1948
离开以前
离开以前 2020-12-14 04:15

As many already posted in other questions (also in jQuery documentation), the old jQuery.browser.version is deprecated and works only in jquery1.3.

Do y

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 05:18

    I Found myself having a issue (border radius on frameset with legend) with IE 9 through 11 (did not check IE 12)
    MSIE is no long user agent in IE 11 and the appName is Mozilla, however trident is in there I managed to extract the trident version # and detect it

    if(navigator.appVersion.indexOf('Trident/')>-1){// Begin stupid IE crap
        var IE=navigator.appVersion;
        IE=IE.slice(IE.indexOf('Trident/')+8);
        IE=IE.slice(0,IE.indexOf(';'));
        IE=Number(IE);
        if(IE>=5&&IE<=7) // IE 9 through IE 11
            document.body.className='ie';
    }    
    

提交回复
热议问题