0

我刚刚将一个 wordpress 站点上传到实时服务器,我看到背景图像和滑块在 Chrome 中不起作用。我不知道当 jquery 正确加载时可能出了什么问题。任何人都能看到我可能错过的明显东西吗?

这是网站: https ://learnmarimba.com

4

1 回答 1

2

您的网站使用 https(安全)协议,并且您正在使用通过 http 调用的资源。Chrome 不喜欢混合使用 https 和 http。您可以在 Crome 控制台中看到警告。

省略协议。所以而不是

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=1.7.1'></script>

采用

<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=1.7.1'></script>

还可以查看有关协议相关网址的这篇文章。

附带说明一下,Google Analytics 包含代码段会检查调用当前网页的协议,并在 url 中使用该协议来包含一个 javascript 文件。

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

来源

于 2013-05-09T18:27:23.053 回答