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

前端 未结 13 933
醉话见心
醉话见心 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:58

    As has been mentioned I'd suggest the best way to achieve this is to use conditional comments to include a stylesheet specific to all versions of IE earlier than 8:

    <!--[if lt IE 8]> Include CSS here <![endif]-->
    

    The included CSS could set a warning to be visible or perhaps enable an overlay on the page which 'locks' users out. It might be a good idea to include some rules which hide important elements on the page which could otherwise confuse the user if they do not work as intended.

    Your other option is to redirect the user to another page - I'm not a huge fan of redirects but if used with care they can be a suitable solution.

    Have you considered why you're locking a large amount of users out of your site? Maybe you should take the time to work out how to either gracefully degrade your JavaScript, or the other way around; 'progressively enhance' with JavaScript.

    On the other hand, you might have control over the systems used by the organisation using your site in which case you're probably OK locking people out for using non-standard systems.

    0 讨论(0)
提交回复
热议问题