Wordpress Ajax Firefox no response Wordpress Ajax Firefox no response wordpress wordpress

Wordpress Ajax Firefox no response


Note that it will work only if you are logged on to WordPress at the time! If you aren’t logged in, wp_ajax calls the hook wp_ajax_nopriv_myfunction.

Links:

https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_nopriv_(action)http://www.simonbattersby.com/blog/2012/06/wordpress-wp_ajax-returning-0-error/

Hope this saves someone an hour or so...


This works in FF, Chrome and IE. Also - add die(); at end of php function

jQuery(document).ready(function(){    jQuery('#test-form input#save').click(function(){            jQuery('#save').attr({'disabled': true});        jQuery.ajax({            type: 'POST',            url:"/wp-admin/admin-ajax.php",            data: {                action: 'test_save',        '_wpnonce': jQuery("input#_wpnonce-save").val(),            },            success: function(results) {          jQuery('#save').attr('value', 'js was Clicked');                jQuery('#test-form').append(results);            }    });    return false;    }); });