+ 5
jQuery is not work in script.js
Hi guys, On script.js, I wrote this code : $(document).ready(function () { // jQuery code here }); when I execute the code. It does not work. Thank you.
6 Respuestas
+ 2
Full Gamer I tried on my computer but it does not work anyway.
+ 1
Full Gamer No it's not that. It's because of document ready.
+ 1
Zohir what do you mean "because of document ready"? first of all you need the jquery library. also you need the block of instructions to be inside a <script> tag because in this way your browser knows that is a script. and the last thing, jquery needs document.ready or load or onload. it depends what you want to do ... but also if you don't include the .js file in .html head file, your code inside .js file wont run. cheers