jQuery滑块和背景图片适用于Firefox,但不适用于Chrome

时间:2013-05-09 18:25:23

标签: jquery google-chrome

我刚刚将一个wordpress网站上传到了实时服务器,我发现背景图片和滑块在Chrome中无效。我不知道jquery正确加载会出现什么问题。任何人都能看到我可能错过的明显事物吗?

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

1 个答案:

答案 0 :(得分: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>

另请参阅protocol relative urls上的这篇文章。

作为旁注,Google Analytics包含代码段会检查调用当前网页的协议,并使用网址中的内容包含javascript文件。

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

Source

相关问题