Javascript for HTTPS

Javascript for HTTPS

本文关键字:HTTPS for Javascript      更新时间:2023-09-26

我一直在浏览谷歌、bing等,试图找出如何让我的脚本正确运行,但谷歌chrome表示,它试图从未经验证的来源加载脚本,我不100%确定这意味着什么。

这是我的登录页面,它在localhost上运行良好,但chrome不喜欢运行脚本。

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script>
      $(function () {
        $('#login').on('submit', function (e) {
          e.preventDefault();
          $.ajax({
            type: 'post',
            url: 'calls.php',
            data: $('#login').serialize(),
            success: function (data, response) {
            if(data==1)
            {    window.location.href = "/account.php";
                return false;}
            else{ $( ".result" ).html( data );}
            }
          });
        });
      });
    </script>
<div style="background-image:url('img/doxramos.png'); background-size:100% 100%; width:455px; height:188px;margin-left:auto; margin-right:auto;"></div>
  <form method="post" class="login" id="login" action="calls.php">
  <input type="hidden" name="process" id="process" value="login">
      <label for="login">Email:</label>
      <input type="text" name="username" id="username" placeholder="name@example.com">
    </p>
    <p>
      <label for="password">Password:</label>
      <input type="password" name="password" id="password" placeholder="Password">
    </p>
    <p class="login-submit">
      <button type="submit" class="login-button" id="submit">Login</button>
    </p>
    <p class="forgot-password"><a href="index.html">Forgot your password?</a></p>
  </form>
<div class = "result" style="text-align:center; margin-left:auto; margin-right:auto;"></div>

这意味着您使用SSL运行当前文件/页面,但您从非https URL获取资源。

只需更改URL

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