【问题标题】:<meta http-equiv=“X-UA-Compatible” content=“IE=edge”> is not working with IE9<meta http-equiv=“X-UA-Compatible” content=“IE=edge”> 不适用于 IE9
【发布时间】:2016-01-27 20:52:25
【问题描述】:

每次当我打开一个包含&lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; 的页面时,页面突然停止并且它说页面没有响应,你知道在我可以使用的页面中关闭兼容性模式的另一种方法吗从IE6到IE10?

【问题讨论】:

  • 检查你的引号,这里是unicode字符。 应该是 "
  • 在我的页面中它们是这样的,并且在除 IE9 之外的所有版本中都能完美运行。
  • 不确定你指的是哪个“那个”,但是 unicode 字符是错误的,浏览器可以对它们做任何事情,因为它们是无效的。
  • 至于替代方案,您可以通过 HTTP 标头设置 X-UA-Compatible。
  • 我去看看,我有点卡住了

标签: html internet-explorer internet-explorer-9 microsoft-edge


【解决方案1】:

希望对你有帮助

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->


    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

【讨论】:

    【解决方案2】:

    根据我的经验,IE9 很棘手 - 它介于您可以处理的 7/8 和更好的 IE10 之间。

    这对我来说一直适用于 IE 7-11:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    
    <head>
    <!--[if IE 8]>
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <![endif]-->
    

    希望这会有所帮助...

    【讨论】:

      猜你喜欢
      • 2017-03-09
      • 2011-01-20
      • 2014-04-25
      • 2013-11-09
      • 2013-11-16
      • 2012-09-05
      • 1970-01-01
      • 2011-11-25
      相关资源
      最近更新 更多