Please write correct Jquery JS and change .click to on(“click”, function(){})
-
Can you please change the .click to on(‘click’, function(){}} so we can get rid of all the warnings and deprecated messages in the js console?
Turn on wordpress script debug mode in the wp-config.php and you will see the messages
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
They are all located in rating.php there are 3 .click left to change.<script> jQuery(document).ready(function ($) { $( '#" . esc_js( $this->text_domain ) . "_btn_already_did' ).on( 'click', function() { $.ajax({ url: ajaxurl, type: 'POST', data: { action : 'wpmet_rating_never_show_message', plugin_name : '" . esc_js( $this->text_domain ) . "', nonce : '" . esc_js( wp_create_nonce( 'wpmet_rating' ) ) . "' }, success:function(response){ $('#" . esc_js( $this->text_domain ) . "-_plugin_rating_msg_used_in_day').remove(); } }); }); $('#" . esc_js( $this->text_domain ) . "_btn_deserved').click(function(){ $.ajax({ url: ajaxurl, type: 'POST', data: { action : 'wpmet_rating_never_show_message', plugin_name : '" . esc_js( $this->text_domain ) . "', nonce : '" . esc_js( wp_create_nonce( 'wpmet_rating' ) ) . "' }, success:function(response){ $('#" . esc_js( $this->text_domain ) . "-_plugin_rating_msg_used_in_day').remove(); } }); }); $('#" . esc_js( $this->text_domain ) . "_btn_not_good').click(function(){ $.ajax({ url: ajaxurl, type: 'POST', data: { action : 'wpmet_rating_ask_me_later_message', plugin_name : '" . esc_js( $this->text_domain ) . "', nonce : '" . esc_js( wp_create_nonce( 'wpmet_rating' ) ) . "' }, success:function(response){ $('#" . esc_js( $this->text_domain ) . "-_plugin_rating_msg_used_in_day').remove(); } }); }); $('#" . esc_js( $this->text_domain ) . "_btn_never_show').click(function(){ $.ajax({ url: ajaxurl, type: 'POST', data: { action : 'wpmet_rating_never_show_message', plugin_name : '" . esc_js( $this->text_domain ) . "', nonce : '" . esc_js( wp_create_nonce( 'wpmet_rating' ) ) . "' }, success:function(response){ $('#" . esc_js( $this->text_domain ) . "-_plugin_rating_msg_used_in_day').remove(); } }); }); }); </script>Thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.