【问题标题】:IE9 compatibility modeIE9兼容模式
【发布时间】:2013-06-21 02:39:12
【问题描述】:

我遇到了一个网站在 IE10 中无法正常运行的问题(某些页面使用 iframe)。在 IE10 中,我可以单击“兼容性视图”按钮,一切正常。

为了避免用户不得不这样做,我尝试在母版页的标题中插入元标记(它是一个 .NET 网站),以及根 web.config(在 system.webserver 配置块中) .我也试过IE=9,IE-8...

没有任何作用。浏览器是否没有正确解释标签?我知道它会看到它,因为当标签存在时,“兼容性视图”图标就会消失。我错过了什么?

【问题讨论】:

  • 最好尝试找出 IE10 无法正常工作的原因,以便可以修复它,而不是更改为更早的文档模式(浏览器模式无法全局更改,除非在兼容列表。见blogs.msdn.com/b/ie/archive/2010/10/19/…)。 IE10 在 F12 控制台中是否给出任何错误?你在使用浏览器嗅探吗?尝试在modern.ie上运行站点扫描仪

标签: view compatibility internet-explorer-10


【解决方案1】:

即 9 – 兼容性:<meta http-equiv="X-UA-Compatible" content="IE=9">
如果你想要 8:<meta http-equiv="X-UA-Compatible" content="IE=8">
如果你想要两者:<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;">

【讨论】:

    【解决方案2】:

    试试

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,requiresActiveX=true">
    

    参考:https://github.com/h5bp/html5-boilerplate/blob/v4.1.0/doc/extend.md#internet-explorer

    【讨论】:

      【解决方案3】:

      尝试添加 Response.Cache.SetCacheability(HttpCacheability.NoCache);

      example:
      <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralLedgerCodeListingCustomForm.aspx.cs" Inherits="xyz.GeneralLedgerCodeListingCustomForm" %>
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <%
          Response.Cache.SetCacheability(HttpCacheability.NoCache);
      %>
      

      【讨论】: