Ok, so I wrote this in my script:
$(document).ready(function(){
alert("works");
})
just a normal document.ready check and it throws 7 errors at me
Can you help me guys?
Ok, so I wrote this in my script:
$(document).ready(function(){
alert("works");
})
just a normal document.ready check and it throws 7 errors at me
Can you help me guys?
From the error, it seems that you are including the jQuery library after you are calling $(document).ready
.
Include your jQuery before any other script in the <head>
Did you include JQuery library? Look at this example:
$(document).ready(function(){
alert("works");
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Your code is ordinary jQuery and should work if there are no library conflicts.
Did you import jQuery? If so check whatever else you imported and ensure there is no conflict. You can try using jQuery.noConflict() to get around any conflicts with other libs.
I'd also suggest you load your JavaScript at the end of the body tag to improve page loading, not in the head as others have suggested. jQuery does need to be included before any dependent code is run of course.