"X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE"
Asked Answered
I

2

234
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
  1. Actually what is the meaning of this statement ?

  2. Some of the examples use , to separate versions of IE, while some use ;; which is correct?

  3. The order IE=9; IE=8; IE=7; IE=EDGE has some importance, I wish to know that.

Edit: I am using <!DOCTYPE html>

Illegible answered 30/1, 2013 at 18:36 Comment(3)
i think IE=9 not fit for X-UA-CompatibleMccants
Google actually recommends it: developers.google.com/web-toolkit/doc/latest/DevGuideIE9Raffish
twigstechtips.blogspot.com/2010/03/…Illegible
R
330

If you support IE, for versions of Internet Explorer 8 and above, this:

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />

Forces the browser to render as that particular version's standards. It is not supported for IE7 and below.

If you separate with semi-colon, it sets compatibility levels for different versions. For example:

<meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />

Renders IE7 and IE8 as IE7, but IE9 as IE9. It allows for different levels of backwards compatibility. In real life, though, you should only chose one of the options:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

This allows for much easier testing and maintenance. Although generally the more useful version of this is using Emulate:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

For this:

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

It forces the browser the render at whatever the most recent version's standards are.

For more information, there is plenty to read about on MSDN,

Raffish answered 30/1, 2013 at 18:39 Comment(10)
the order IE=9; IE=8; IE=7; IE=EDGE has some importance, i wish to know thatIllegible
I have a bit of a gap in my understanding of this. If my target for testing is IE8, but I don't want to break IE7, what would you set this meta tag to? And do any other browsers use this?Houseboat
IE7 will not recognize this, it was implemented first in IE8. The entire reference to IE7 above is if, for example, you were using IE7 as the basis for testing, and wanted all more modern versions of IE to render as it would in IE7 standards. no other browsers use this tag.Raffish
IE10 renders old web apps well with IE=8 (YMMV), however IE11 emulation of IE8 breaks. This UA: content="IE=8; IE=11" gives browser mode IE10 Compat Document mode IE8 standards in IE10, and Document mode edge in IE11. One of the issues with IE10 and IE11 UA assignment is that Microsoft removed conditional comments.Package
Based on that meta tag, IE11 would not emulate IE8, it would assume IE11 (as that was given in the semicolon-separated list). That list would also explain the fallback to IE8 standards because IE10 was unaware of the existence of IE11, just as IE8 could not apply IE9 standards. Have you tried simply using content="IE=8"? Or, preferrably, content="IE=EmulateIE8"?Raffish
See also: #6771758Hash
Excelent articule, I was using content="IE=EmulateIE9", so AjaxControlToolkit:ModalPopupExtender does not work with asp:ScriptManager.. I changed it for content="IE=Edge" and it Works great...Yesterday
What’s the difference between the version of the syntax discussed here IE=8; IE=9 vs. what’s in Microsoft’s documentation: IE=8, 9. Do all versions of IE support both? Do both work with ChromeFrame? If so, are both syntaxes ok when we use the HTTP Header instead of the <meta> tag?Opener
The solution for forcing IE to use Edge version despite of IE10 (default), I changed content="IE=IE11" because content="IE=edge" did not work.Method
IE=Edge avesome option. Now even my WindowsXP program ActiveX finally shows IE11 , not IE8 css style sheets. Thanks a lot !Gossett
T
4

In certain cases, it might be necessary to restrict the display of a webpage to a document mode supported by an earlier version of Internet Explorer. You can do this by serving the page with an x-ua-compatible header. For more info, see Specifying legacy document modes.
- https://msdn.microsoft.com/library/cc288325

Thus this tag is used to future proof the webpage, such that the older / compatible engine is used to render it the same way as intended by the creator.

Make sure that you have checked it to work properly with the IE version you specify.

Toluca answered 6/6, 2016 at 19:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.