Reputation: 1
My JQuery code is not working. I tried functions such as "mouseenter" and that didn't work, so I simply tried this and the alert does not show up. Is it a problem with the syntax or possibly something I am missing?
<script type="text/javascript" src="jquery-2.0.0.min.js"></script>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<script type="text/javascript" src="script.js"></script>
The JS is this:
$(document).ready(function() {
alert("JQuery is working! :D");
});
EDIT:
scr -> src However, this has not solved the problem.
I am using Chrome v. 26 on Mac OSX 10.7.5
This is the console error: Uncaught SyntaxError: Unexpected token }
Upvotes: 0
Views: 133
Reputation: 150108
The line
<script type="text/javascript" scr="jquery-2.0.0.min.js"></script>
has "src" misspelled.
It should be
<script type="text/javascript" src="jquery-2.0.0.min.js"></script>
As a result, jQuery is not loading.
When diagnosing this type of issue, it is useful to open the JavaScript console. In IE or Chrome, press F12 then select the JavaScript tab. You would probably see an error along the lines of "$ is not defined".
Upvotes: 4