Why JS returns $ is not defined? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why JS returns $ is not defined?

When I write jQuery code in js, starting with $(document).ready(function(){ }); the js returns that $ is not defined. How to solve thiss issue?

25th Jul 2017, 11:00 AM
Dragan Lazarevski
2 Answers
+ 10
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> add this in the head tag
25th Jul 2017, 11:04 AM
The Coding Sloth
The Coding Sloth - avatar
+ 6
yeah it will only work if you refer the jquery library's link in the head tag
25th Jul 2017, 11:39 AM
_Retr0/-
_Retr0/- - avatar