Using <meta http-equiv=“X-UA-Compatible” content=“IE=8” /> mode in sites good practice?

前端 未结 6 1253
感动是毒
感动是毒 2020-12-10 03:48

I\'ve recently discovered the joys of adding the following into the header of sites:



        
相关标签:
6条回答
  • 2020-12-10 04:18

    I have IE8 installed in a Windows 7 test environment and it renders some parts of my code like IE7 did before (an there is no content="IE7" in my meta-tags)!
    On another machine with Windows 7 + IE8, the code is rendered different, but the way I want.
    There's an interesting article at http://www.greywyvern.com/?post=313 telling that the way IE8 renders depends of the Service Pack installed on the system (the article is about XP, but mine is Windows 7 and I have the same issue).

    So now I put content="IE10" on my webpages and my website is correctly displayed in IE10, IE9 and IE8.

    0 讨论(0)
  • 2020-12-10 04:27

    Another thing to be aware of is that the tag examples microsoft have provided don't always work. read defining document compatibility, especially the community additions at the bottom of the page.

    As far as best practice goes, they are probably not the best long term solution but came in very handy when IE9 was released and sites went down.

    0 讨论(0)
  • 2020-12-10 04:33

    Backward compatibility as rightly said by everyone should be applied only when it is strictly required as it does not works perfectly, and NO you can not get the features of new browser to old browser just by adding the compatibility tag.

    0 讨论(0)
  • 2020-12-10 04:37

    The short answer to the last part of your question is no: IE7 can't be made to work in IE8 mode. So using the X-UA-Compatible header won't force older versions of IE to think they're a newer version. (if that worked, we could all just start using content="IE-10" and be done with worrying about backward compatibility forever)

    What the X-UA-Compatible flag does is tell newer versions of IE to fall back into compatibility mode to emulate older versions. So therefore, your content="IE-8" flag will have no effect on IE7 or IE8, but will make IE9 fall back into IE8 mode.

    This means that IE9 will effectively throw away its newer features, in the name of trying to be backward compatible.

    If this is what you want from IE9, then by all means use the X-UA-Compatible header. If it isn't what you want, then don't use it.

    (it's worth noting that the backward compatibility modes in IE are known to be not very good at being 100% compatible with real copies of the version they're trying to emulate, so don't think that you'll get a perfect copy of IE8 running in IE9 either -- it'll have it's own quirks that are different to either IE8 or IE9 in normal mode)

    0 讨论(0)
  • 2020-12-10 04:40

    I'm using Discus, it is not compatible with older versions of IE. I got help they said to use content="IE-8" in my page code...

    content="IE-8" also told my browser to change the sizes of tables and texts etc :p I changed to content="IE-7" it works perfect.

    0 讨论(0)
  • 2020-12-10 04:41

    Adding <meta http-equiv=“X-UA-Compatible” content=“IE=8” /> mode in not probably good idea since it will stop your application to take advantages of newer versions of browser. But I think adding <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> is good since It forces the browser the render at whatever the most recent version's standards are.

    Note: Adding Edge can potentially break your code since your application might not be tested for this new version. In most cases, this works absolutely fine, but you never know.

    For details about other possible options refer

    “X-UA-Compatible” content=“IE=9; IE=8; IE=7; IE=EDGE”

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