Html 是否有 IIS 设置来提示浏览器进入兼容模式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16531177/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 08:21:41  来源:igfitidea点击:

Is there an IIS setting to hint the browser to go into compatibility mode?

htmlhttpiis-7

提问by developer747

I can modify the Document modethat IE renders the page in, by passing in a X-UA-Compatible in the response header. I can achieve this by modifying a setting in IIS. enter image description here

我可以通过在响应头中传入 X-UA-Compatible来修改IE 呈现页面的文档模式。我可以通过修改 IIS 中的设置来实现这一点。 在此处输入图片说明

Similarly is there a way to modify the Browser modeto Compatibility view by modifying any setting in the IIS?

同样,有没有办法通过修改 IIS 中的任何设置来将浏览器模式修改为兼容性视图?

Shown below is what I currently see in the F12 tool in ie.

下面显示的是我目前在 ie 中的 F12 工具中看到的内容。

f12 screenshot

f12截图

回答by Blaze7

To configure IIS 7 on a Windows Server 2008-based computer to include a custom HTTP response header:

要在基于 Windows Server 2008 的计算机上配置 IIS 7 以包含自定义 HTTP 响应标头:

  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In the connections pane, expand the node for the server, and then expand .
  3. Click the Web site where you want to add the custom header.
  4. In the Web site pane, double-click in the section IIS on HTTP Response Headers.
  5. Under Actions, click Add.
  6. In the Name box, type X-UA-Compatible.
  7. In the Value box, type IE=EmulateIE9.
  8. Click OK.
  1. 单击开始,单击管理工具,然后单击 Internet 信息服务 (IIS) 管理器。
  2. 在连接窗格中,展开服务器的节点,然后展开 。
  3. 单击要添加自定义标头的网站。
  4. 在网站窗格中,双击 HTTP 响应头上的 IIS 部分。
  5. 在操作下,单击添加。
  6. 在名称框中,键入 X-UA-Compatible。
  7. 在值框中,键入 IE=EmulateIE9。
  8. 单击确定。

Hope this helps!

希望这可以帮助!

回答by DavidCru

I was also looking into this issue and found my answer here:

我也在研究这个问题,并在这里找到了我的答案:

http://www.nczonline.net/blog/2010/01/19/internet-explorer-8-document-and-browser-modes/

http://www.nczonline.net/blog/2010/01/19/internet-explorer-8-document-and-browser-modes/

From that site:

从那个网站:

There doesn't appear to be any other way that and end user can trigger Internet Explorer 7 mode. As such, it appears that this is just a convenience tool for developers that frees us from needing to and so it appears to be a tool used primary for developers

似乎没有任何其他方式和最终用户可以触发 Internet Explorer 7 模式。因此,对于开发人员来说,这似乎只是一个方便的工具,可以让我们免于需要,因此它似乎是开发人员主要使用的工具

The same thought can be applied to IE10 I guess. It's rather frustrating, but I hope it helps.

我猜同样的想法可以应用于 IE10。这相当令人沮丧,但我希望它有所帮助。