我一直在浏览google,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>
答案 0 :(得分:0)
这意味着您使用SSL运行当前文件/页面,但是您从非https网址获取资源。
只需更改网址
即可<script src="https://code.jquery.com/jquery-1.9.1.js"></script>