Uncaught ReferenceError: $ is not defined
To solve this error:
In the following code, you can see that the jQuery library is loaded after the script. So, you will get "$ is not defined" error.
There can be multiple other reasons for this issue:
There may be a chance where you are working offline but trying to loading or referring the jQuery code from internet . In this case, there is a problem with the internet connection and jQuery will not load from the CDN . In this case, you can simply download the jQuery.js and use it locally rather then downloading from internet and use the code below to load jQuery locally :
Conflict with Other Libraries
Path to jQuery library you included is not correct
You might have put an incorrect path to jQuery library , or there may be typo in your file.
The above code does not include the HTTP: or HTTPS: in the src attribute but the browser, FireFox, needed it so you should changed it to:
The jQuery library file is corrupted
If the jQuery library file has been downloaded from an untrustworthy sites and the file is corrupted, this error may happen.