【问题标题】:Chrome - "Trying to load script from unauthenticated sources"Chrome - “尝试从未经身份验证的来源加载脚本”
【发布时间】:2017-05-11 18:09:27
【问题描述】:

我的网站出现了一些问题。它运行和渲染都很好,但是我在地址栏的右上角看到了被阻止的脚本图标。我不希望用户在访问该站点时看到此弹出窗口。我可以按“加载不安全的脚本”,这将使它消失,但我的网站不再是 https。我已经尝试重新排列线条并在我的 html 中尝试了其他东西,但我似乎找不到解决方案。 该站点使用引导程序以及我自己的 2 个 CSS 文件和 1 个 JavaScript 文件。 下面是 HTML 头标签。下面是 Chrome 显示的错误。有谁明白为什么会这样?

<head>
    <meta charset="utf-8"> 
    <meta name="keywords" content="NASA,JPL,near,earth,objects,asteroid,meteor,neo,neowise,api,opendata">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nearing Earth</title>

    <!-- Lines necessary for Bootstrap-->
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <!--My files-->
      <link rel="stylesheet" href="neoRules.css">
    <link rel="stylesheet" src="neoStyles.css">
    <link rel="icon" type="image/ico" href="favicon.ico"/>
    <script src="https://nearingearth.com/neoFunctions.js" type="text/JavaScript"></script>

      <!--[if lt IE 9]>
      <script src="/js/html5shiv.js" type="text/javascript"></script>
      <script src="/js/respond.min.js" type="text/javascript"></script>
      <![endif]-->
  </head>

错误 1:

混合内容:“https://nearingearth.com/”处的页面已加载完毕 HTTPS,但请求了不安全的脚本 'http://code.jquery.com/jquery-latest.min.js'。该请求已 受阻;内容必须通过 HTTPS 提供。

错误 2:

未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery 在 bootstrap.min.js:6

【问题讨论】:

    标签: javascript jquery html css google-chrome


    【解决方案1】:

    neoFunctions.js 正在加载不带 SSL 的 jquery。这与您的 HTML 无关。我可能会建议下载 neoFunctions.js 并修改脚本以将 http:// 的实例替换为 https:// 并将其托管在您自己的服务器上。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多