【发布时间】:2013-08-12 16:53:13
【问题描述】:
我正在使用 jQuery 循环创建一些画廊,一切都很棒,在本地。但是在服务器上我收到以下两条错误消息:
未捕获的 SyntaxError:输入 jquery-cycle.js:1 意外结束
Uncaught TypeError: Object [object Object] has no method 'cycle
包括jQuery和Cycle:
<script src="<?php bloginfo('template_url'); ?>/js/jquery-latest.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/js/jquery-cycle.js" type="text/javascript"></script>
我的 jQuery 循环函数:
<script>
$(function() {
$('#mini-gallery').cycle({
speed: 800,
timeout: '6500',
pause: 'true',
cleartypeNoBg: 'false',
containerResize:0,
slideExpr: '.testimonial-mini-item'
});
});
</script>
为什么我会在实时服务器上收到这些错误消息?
更新
我已将加载 Cycle 插件的方式更改为:
<script src="http://malsup.github.io/jquery.cycle.all.js"></script>
现在插件运行良好。任何想法为什么现在有效?这与我使用服务器 IP 地址而不是域这一事实有关吗?
【问题讨论】:
-
检查你的网络(Firebug,或者webkit提供的东西,如果你使用chrome)看看你是否真的下载了插件
标签: php jquery syntax-error cycle