是否在X-UA兼容HTTP头实际上是IE9工作? [英] Does the X-UA Compatible http header actually work for IE9?

查看:268
本文介绍了是否在X-UA兼容HTTP头实际上是IE9工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作可能被作为承载Intranet站点的Web产品。我试图找到一种编程方法,以保持IE9滑入IE9兼容性视图浏览器模式下,即使在兼容性视图中显示Intranet站点可能是。

I'm working on a web product that may be hosted as an intranet site. I'm trying to find a programmatic way to keep IE9 from slipping into IE9 Compatibility View browser mode, even though 'Display Intranet sites in Compatibility View' may be on.

我与这个html页面测试:

I'm testing with this html page:

<!DOCTYPE HTML>

<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <title>Company</title>
    </head>
    <body>
    </body>
</html>

我已经把这个在IIS中配置:

I've put this in IIS config:

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <clear />
            <add name="X-UA-Compatible" value="IE=edge" />
        </customHeaders>
    </httpProtocol>

如下建议: http://stackoverflow.com/a/5887546 ,并在IE9检查响应头,看看

as recommended here: http://stackoverflow.com/a/5887546, and checked the response headers in IE9 and see:

X-UA-Compatible     IE=Edge

但网页仍然把浏览器在兼容性视图浏览器模式。

But the page still puts the browser in Compatibility View browser mode.

控制台显示:

HTML1202: http://intranet-site/test.html is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked. 
test.html

有一个类似的问题在这里: http://stackoverflow.com/a/372​​6605/1279516 ,其中所选择的答案雅各意见建议,在IE9中,没有什么可以做,以覆盖设置在兼容性视图中显示Intranet站点。然而,他的评论是我发现的这个提到的唯一地方。任何人都可以证实或否认这一说法?

There's a similar question here: http://stackoverflow.com/a/3726605/1279516, in which a comment by Jacob on the chosen answer suggests that in IE9, there's nothing you can do to override the 'Display Intranet sites in Compatibility View' setting. However, his comment is the only place I've found mention of this. Can anyone confirm or deny that assertion?

和有什么我能试试吗?我不应该告诉谁部署我们产品的所有客户取消浏览器设置了在兼容性视图中显示Intranet站点为他们的所有用户。

And is there anything else I can try? I shouldn't have to tell all clients who deploy our product to uncheck the 'Display intranet sites in Compatibility View' browser setting for all their users.

推荐答案

除非有人说,否则,奥廖尔的评论表明,所有功能都基于文档模式提供,因此没有必要试图控制浏览器模式进一步,一旦你得到你想要的文档模式。

Unless someone says otherwise, oryol's comment suggests that all features are made available based on Document Mode, so there's no need to try to control browser mode further once you are getting the document mode you want.

这篇关于是否在X-UA兼容HTTP头实际上是IE9工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆