views:

39

answers:

2

I'm running around in circles trying to figure out why I can't get jQuery Cycle to work in our Amazon store. jQuery seems to be working fine, as I can run commands from the console, but any time I try to call .cycle(), i get a "*.cycle() is not a function" error. I've used cycle on several other websites with no problems, but this has completely confounded me.

Here's a link to a very basic test page with a Cycle instance that I can't get to work: http://www.st-amz.com/content/Slideshow.htm

Amazon's code is a complete mess, so it could have something to do with stuff on the page being non-compliant, I don't know. ANY help would be appreciated.

+1  A: 

The path to your cycle plugin isn't correct, this results in a 404:

<script type="text/javascript" src="images/jquery.cycle.min.js"></script>

Looks like this isn't the right URL:

http://www.st-amz.com/content/images/jquery.cycle.min.js
Nick Craver
Wow, that's an even more frustrating typo than hunting for a missing semicolon in PHP! Thanks for finding that for me. I could have sworn it was pointing to the right path.
Tim Mackey
+1  A: 

Your script tag is pointing to the wrong URL:

http://www.st-amz.com/content/images/jquery.cycle.min.js

But cycle is located off your root:

http://www.st-amz.com/images/jquery.cycle.min.js

So change the script tag to use a root-relative path and it should work as expected:

<script src="/images/jquery.cycle.min.js" type="text/javascript"></script>
Jeff Sternal
Wow, that's an even more frustrating typo than hunting for a missing semicolon in PHP! Thanks for finding that for me. I could have sworn it was pointing to the right path.
Tim Mackey