【问题标题】:error Https for jquery library when change http to https mvc [duplicate]将http更改为https mvc时jquery库的错误Https [重复]
【发布时间】:2019-11-02 01:08:49
【问题描述】:

我几天前更改了我的应用程序端口(@98​​7654323@ app -> httphttps)。

更改后,我在浏览器的控制台中看到错误:

如何解决?

【问题讨论】:

  • 请在此处以文本形式发布错误消息 - 从屏幕截图中无法读取。
  • 你需要通过 https 访问 jquery。在所有 jquery 插件 url 中将 http 替换为 https。

标签: c# asp.net-mvc model-view-controller


【解决方案1】:

您不仅必须使用证书保护您的网站(您似乎已经这样做了),您还必须通过 HTTPS 请求从您的网站加载的每个资源。例如:

<script src="http://code.jquery.com/jquery-3.3.1.js"></script>

应该是

<script src="https://code.jquery.com/jquery-3.3.1.js"></script>

我测试过,code.jquery.com 支持 HTTPS URLs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-29
    • 2016-07-10
    • 2018-05-22
    • 2015-01-21
    • 1970-01-01
    • 2020-11-18
    • 2018-03-08
    • 2014-10-26
    相关资源
    最近更新 更多