现在维护的项目中使用了

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

来把IE8带入IE7标准,今天测试提出一个IE8下的小BUG,简单分析了一下,发现浏览器始终为IE8标准,并未切换到IE7标准(F12调出开发工具,文本模式自动勾选在IE8标准)

翻了下MSDN《定义文档兼容性》,里面有这么一句:

X-UA-compatible 标头不区分大小写;不过,它必须显示在网页中除 title 元素和其他 meta 元素以外的所有其他元素之前的标头(HEAD 节(可能为英文网页))中。

MSDN有机器翻译的传统,再看下英文版

The X-UA-compatible header is not case sensitive; however, it must appear in the Web page’s header (the HEAD section) before all other elements, except for the title element and other metaelements.

而项目中是:

<head>
<script ...
<link href="xxx.css" ...
<meta ...

杯具就这么发生了…