doushang8846 2013-08-12 16:53
浏览 53
已采纳

jQuery Cycle Uncaught SyntaxError:意外的输入结束

I'm using jQuery cycle to create a few galleries and everything is great, locally. However on the sever I get these two error messages:

Uncaught SyntaxError: Unexpected end of input jquery-cycle.js:1

Uncaught TypeError: Object [object Object] has no method 'cycle

Including jQuery and 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>

My jQuery Cycle function:

    <script>
      $(function() {
        $('#mini-gallery').cycle({
          speed: 800,
          timeout: '6500',
          pause: 'true',
          cleartypeNoBg: 'false',
          containerResize:0,
          slideExpr: '.testimonial-mini-item'       
        });
       });
     </script>

Why am I getting these error messages on the live server?

UPDATE

I've changed the way I load the Cycle plugin to this:

   <script src="http://malsup.github.io/jquery.cycle.all.js"></script>

Now the plugin works great. Any ideas why this works now? Would this have anything to do with the fact that my I'm using a server IP address and not a domain?

  • 写回答

2条回答 默认 最新

  • doulian7305 2013-08-12 17:02
    关注

    I would double check to make sure your jquery-cycle.js file doesn't have a missing bracket or something in there that causes the page to fail while loading it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误