How can I show a message to IE6/IE7 browsers to upgrade to IE8 and have IE8 not show the IE7 warning?

前端 未结 13 936
醉话见心
醉话见心 2020-12-08 02:53

I want to only allow users with IE8 (not IE6, IE7) or another browser to access my site when logged in.

I followed: http://code.google.com/p/ie6-upgrade-warning/ But

13条回答
  •  独厮守ぢ
    2020-12-08 03:31

    Rather than try to force IE 8+ mode, I use a combination of conditional comments and a simple javascript check. The document.documentMode property was added to IE in version 8, so if it exists at all (regardless of value, though it HAS to be 7 with this code) it means we're in compatibility mode and should not show the warning:

    
    

提交回复
热议问题