Fortunately, unless you wish to refractor your entire code to support IE8 strictness, MS did add a "compatibility" switch, via the X-UA-Compatible meta-tag or header, if you change its value to "IE=EmulateIE7" it makes it emulate the "strict" mode ala IE7, which at least in all of our code makes it render things properly. However, there is a "slight" problem, which I discovered while trying to implement this function.
According to the docs, you can trigger this behavior via the following meta tag:
, unfortunately it didn't work and according to the IE8's developer tool the default strict mode of IE8 was still being used. No matter the value, be it IE=IE7 or IE5 or EmulateIE7, it would just be ignored. Eventually, I realized that perhaps the DTD is the problem, our pages use XHTML/Transitional DTD, (
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
), which means custom meta tags are effectively spec violations. Which, as far as I can tell IE8 in it's strict mode happily ignores, Catch 22!. This is despite a nice note inside MSDN Blog that says:
NOTE: The X-UA-Compatible tag and header override any existing DOCTYPE.
The solution, is to set the X-UA-Compatible value via an HTTP header ala:
This means the parameter is outside of HTML and will get properly captured by IE, in our case that solved all of the JS and CSS issues that appeared in IE8. For those of you using ExtJS date picker, this does solve the cut-off of the calendar window.
You often mention "strict" mode, I guess you are meaning "standard" (rendering) mode.
You also mention the http-equiv value as "IE=IE7 or IE5". According to the docs, these values are not accurate: see
Those should be IE=7 or IE=5
Can you provide examples of what you tested to come to this article?
As noted, the placement of the meta tag as first in the head section is important. However, the server may override this. In a case like that, as with server overrides of character encoding meta tags, the method shown for PHP is a workable solution.
John Davenport Scheuer