Skip to main content
improved answer
Source Link

Put this in your .js file

(function($) { // Your code inside here; })(jQuery); 

This is called an anonymous function, you're passing the jQuery object as a parameter to it.

OR

 var $ = jQuery; // This at the top of the file 

This is simple, you're just assigning the jQuery object to the $ variable

References:

is-not-a-function-jquery-error

jquery-is-not-a-function-error

Put this in your .js file

(function($) { // Your code inside here; }); 

OR

$ = jQuery; // This at the top of the file 

Put this in your .js file

(function($) { // Your code inside here; })(jQuery); 

This is called an anonymous function, you're passing the jQuery object as a parameter to it.

OR

 var $ = jQuery; // This at the top of the file 

This is simple, you're just assigning the jQuery object to the $ variable

References:

is-not-a-function-jquery-error

jquery-is-not-a-function-error

Source Link

Put this in your .js file

(function($) { // Your code inside here; }); 

OR

$ = jQuery; // This at the top of the file