【问题标题】:HTML5 Shiv Google CDN Link Not WorkingHTML5 Shiv Google CDN 链接不起作用
【发布时间】:2016-05-14 09:31:51
【问题描述】:

此 Shiv Google CDN 链接不起作用。我该怎么办?

<!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

【问题讨论】:

  • 你应该停止依赖外部文件。自己主持。这种方式也适用于 Intranet。
  • 将此代码放在 html 的 head 部分。
  • 我做了但没用。
  • 好吧,如果下面的答案有用,请接受这个答案...

标签: javascript html html5shiv


【解决方案1】:

发生这种情况是因为 CDN 链接已针对 html5shiv 更新。

改用this from CDNJS

<!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->

希望这对你有帮助:)

【讨论】:

  • 我应该为 html5shiv 烦恼吗?真的有人还在用老版本的IE吗?
【解决方案2】:

很好,但我认为最好不要添加https://

那就试试吧:

src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"

来源:https://github.com/twbs/bootstrap/commit/2b802d651dbe4305221cc7c4a2e45123b9e8b699

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-27
    • 2014-09-10
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 2023-04-07
    相关资源
    最近更新 更多