Differentiate IE7 browser and browser in IE7 compatibility mode

后端 未结 5 1535
半阙折子戏
半阙折子戏 2020-11-27 07:00

Can I differentiate if client\'s browser is IE7 or e.g. IE9 in IE7 compatibility mode? I\'m trying to figure out if I can do a JS check on my site which would recognize two

5条回答
  •  鱼传尺愫
    2020-11-27 07:28

    For anyone reaching this thread on Google, here is another option:

    Using the script located at http://www.quirksmode.org/js/detect.html....

    if (BrowserDetect.browser == 'Explorer')
    {
        if (document.documentMode == 7 && BrowserDetect.version > 7)
        {
            // user is running IE in compatability mode
        }
    }
    

提交回复
热议问题