Here is my script code:
<script src="//code.jquery.com/jquery.js" defer></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" defer></script>
<script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js" defer></script>
I try to create an ajax function, but it show some error in console :
Uncaught ReferenceError: $ is not defined
How can I proceed?
2
Answers
This error means your jQuery file has not been loaded. Based on your code, you have to remove one of the script tags that load the jQuery library. Then check that the path for loading jQuery is correct. You can do that by viewing the page source (in most browsers ctrl+u) and clicking on the script address and check if the file loads correctly.
Your file can’t be found. Try to replace your code from your current code to this.