$ is not a Function is one of the most common jQuery function is encountered while working with jquery. Fresher or and Experienced developer, everyone faces this error in their daily development projects.
How Do I Remove the Monitoring Script from Godaddy
$ is not a function error can be caused due to various reasons as mentioned below:
- Due to jQuery conflict
- Due to not calling the jQuery library file before function
- Calling multiple jQuery library files in single page
$(function($) {}); Calling $ before function can also cause this issue sometimes, try to avoid it.
$ is not a functions can be easily solved by the following methods:
There are quite lots of answers based on the situation.
1) Try to replace ‘$’ with “jQuery”
2) Check that code you are executed are always below the main jquery script.
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
});
</script>
3) Pass $ into the function and add “jQuery” as a main function like below.
<script type="text/javascript">
jQuery(document).ready(function($){
});
</script>
Comments