【问题标题】:I have a red line under the script tag when linking to jquery [duplicate]链接到 jquery 时,脚本标记下有一条红线 [重复]
【发布时间】:2021-12-13 09:49:39
【问题描述】:

试图链接到 jquery。我的代码有效,但脚本下仍有一条红线,所以我不知道可能出了什么问题

Here is the code

Here is what it says on the with red line under

【问题讨论】:

标签: html jquery linker


【解决方案1】:

如何在 jQuery CDN 中包含 jQuery:https://code.jquery.com/

最新的 jQuery 3 版本:

<script
    src="https://code.jquery.com/jquery-3.6.0.min.js"
    integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
    crossorigin="anonymous"></script>

    

完整性和跨域属性用于子资源 完整性 (SRI) 检查。这允许浏览器确保 托管在第三方服务器上的资源未被篡改。 推荐使用 SRI 作为最佳实践,只要图书馆是 从第三方来源加载。

我觉得说的都简单明了,没必要再补充了。

关于缩小版 3.3.1 的完整性属性

<script
    src="https://code.jquery.com/jquery-3.3.1.min.js"
    integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
    crossorigin="anonymous"></script>

【讨论】:

    猜你喜欢
    • 2010-09-19
    • 2014-02-22
    • 1970-01-01
    • 2017-07-30
    • 2011-09-29
    • 2014-01-13
    • 2015-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多