doushang8846
2013-08-12 16:53
浏览 52

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.

    打赏 评论
  • dr897777 2013-08-13 13:55

    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?

    打赏 评论

相关推荐 更多相似问题