【问题标题】:Make IE7 compatible using CSS conditional comment使用 CSS 条件注释使 IE7 兼容
【发布时间】:2015-09-04 07:49:51
【问题描述】:

我一直在努力使我的网站与 IE7 兼容。我使用这个代码是我的head 标签,以确保如果网站在 IE7 上运行,它应该使用 jquery 1.7 而不是 jquery 2.1。

 <!--[if IE 7]>
  <script src="../../common/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<![endif]-->

<!--[if lt IE 9]>
 <script src="../../common/js/jquery-2.1.1.min.js"></script>
<![endif]-->

但我仍然收到这样的错误:

这意味着该网站仍在使用Jquery-2.1.1,但我正在IE7上进行测试。

这段代码有什么问题?

【问题讨论】:

    标签: javascript jquery internet-explorer-7 x-ua-compatible


    【解决方案1】:

    你的第二个做到了!所以先加载吧!

    <!--[if lt IE 9]>
      <script src="../../common/js/jquery-2.1.1.min.js"></script>
    <![endif]-->
    <!--[if IE 7]>
      <script src="../../common/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <![endif]-->
    

    或者使2.1.1,大于IE 7!

    <!--[if gt IE 7]>
      <script src="../../common/js/jquery-2.1.1.min.js"></script>
    <![endif]-->
    

    【讨论】:

    • 我不明白。所以我的条件无效?
    • lt IE 9 是什么?小于 IE 9。IE 7 小于 IE 9!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-25
    • 1970-01-01
    • 1970-01-01
    • 2011-07-27
    • 2011-09-29
    • 2012-08-04
    • 2015-03-04
    相关资源
    最近更新 更多