-7

I'm having a little problem with jQuery

 <head>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">  </script>            
 <script    src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
 <script> $('.rotator').cycle({ fx: 'fade', timeout: 7000 }); </script>
 </head>

<body>

<div class="rotator">
<img src="1.jpg">
<img src="2.jpg">
<img src="3.jpg">
<img src="4.jpg">
</div>

</body>

Was working fine earlier today then it just stopped working? is there something wrong?

Huangism
  • 16,278
  • 7
  • 48
  • 74

1 Answers1

6
http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js

Gives me an Access Denied. Something tells me that link shouldn't be used as a CDN.

I'd say go download cycle, place it in your website's directory then include that reference, and don't use github as a CDN.

If you really want it hosted elsewhere, either look on cdnjs.com and, if it's not already there, ask them to add it.

As a final note, you should never rely on a CDN hosting the only version of a library--always have a local backup. You see this commonly wiht jQuery to the effect of:

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/jquery-2.0.3.min.js"><'+'/script'>');</script>
Brad Christie
  • 100,477
  • 16
  • 156
  • 200