Can't get jQuery Cycle to work in Amazon Webstore
-
29-09-2019 - |
문제
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.
해결책
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>
다른 팁
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