AJAX not working
-
Looks like the front-end script for mailchimp requieres jQuery to work but the dependency is not declared.
In
mailbag.php
on line 102 and 103 there are two script that require jQuery:wp_enqueue_script( 'mailbag_ajaxChimp', plugin_dir_url(__FILE__) . 'includes/js/jquery.ajaxchimp.js', '2.2.1', true ); wp_enqueue_script( 'mailbag-front-js', plugin_dir_url(__FILE__) . 'includes/js/mailbag.js', '2.2.1', true );
It should be:
wp_enqueue_script( 'mailbag_ajaxChimp', plugin_dir_url(__FILE__) . 'includes/js/jquery.ajaxchimp.js', array( 'jquery' ), '2.2.1', true ); wp_enqueue_script( 'mailbag-front-js', plugin_dir_url(__FILE__) . 'includes/js/mailbag.js', array( 'jquery' ), '2.2.1', true );
On my site jQuery is loading after these two scripts and throwing a JS error.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘AJAX not working’ is closed to new replies.