【问题标题】:prevent IE9 from entering compatibility view阻止 IE9 进入兼容性视图
【发布时间】:2013-06-02 02:43:58
【问题描述】:

我正在为 IE9 编写代码。

有时我会看到选项工具 ➝ 兼容性视图被自动选中(我不希望这样,因为我必须不时取消标记它)。

当上面的兼容性视图选项被勾选时,会弹出如下一段代码:

<!--[if lt IE 8]>
    <div style=' clear: both; text-align:center; position: relative;'>
        <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
            <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
        </a>
    </div>
<![endif]-->
<!--[if lt IE 9]>
    <script type="text/javascript" src="js/html5.js"></script>
<![endif]-->

我怎样才能防止这种行为一次又一次地发生?

【问题讨论】:

    标签: internet-explorer-9 detect ie-compatibility-mode


    【解决方案1】:

    你可以试试这个:

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

    【讨论】:

    猜你喜欢
    • 2012-03-03
    • 2012-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-10
    • 2015-08-11
    • 2017-02-11
    • 1970-01-01
    相关资源
    最近更新 更多