2 questions.
It looks like your jQuery has not been loaded properly.
You usually see this error
Uncaught ReferenceError:$ is not defined
when jQuery was not correctly included in your page.
Try using jQuery from the CDN and it should solve your problem.
Replace
<script src="JS/jquery-1.10.1.min.js"></script>
with one of cdn
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
NOTE: if you are testing from the file system, you need to add http: to the above URL, otherwise it will fail
Next, your script file is before the HTML . Therefore, you must contain the code in the DOM Ready handler.
$(function() { $('#slider').cycle({ fx: 'scrollHorz', speed: 'fast', next: '#next', prev: '#prev' }); });
As far as I know, "Slider" was referenced when I created the div identifier.
No, it is not. If your script was included immediately before the body, you cannot wrap it in a Ready handler. But in your case, it is present in the head. Therefore, when the script starts working, this particular element is still not present in the DOM
Check feed
Sushanth -
source share