Jquery Requires The Word Jquery Instead Of $
I am working on a WordPress theme and I have included Jquery, // Waves wp_enqueue_style( 'APKMirror-wave', get_template_directory_uri() . '/inc/waves/waves.min.css');
Solution 1:
jQuery in WordPress runs in noConflict mode which means the global $ shortcut for jQuery isn't available. Use the document ready wrapper which will allow $ to be used as an alias for jQuery.
jQuery(document).ready(function($) {
// Inside here $ can be used instead of jQuery.
});
Or
(function($) {
// Use $ here.
})(jQuery);
Thanks to Paulpro for correctly pointing out that there is an alternative that can be used if you need to run the script before the rest of the DOM loads.
Post a Comment for "Jquery Requires The Word Jquery Instead Of $"