title: Wordpress when sending a WP_Ajax_Response the response is not received
body: <p>I'm searching for days now for a solution to my problem.
  When I send a WP_Ajax_Response the clientside is not receiving it.
  I checked all possible tips on internet but still I can't get it working.
  Can somebody help me?</p>
  
  <p>I registered the javascript file:</p>
  
  <pre><code>wp_register_script('test-ajax-js',get_template_directory_uri() . '/library/script/ajax.test.js', array( 'jquery', 'wp-ajax-response' ), '1.0' );
  wp_enqueue_script( 'test-ajax-js');
  wp_localize_script( 'test-ajax-js', 'ajaxtest', 
                      array( 
                          'Ajax_Url' =&gt; admin_url( 'admin-ajax.php' ),
                          'deshopNonce' =&gt; wp_create_nonce( 'deshop-ajax-test-nonce' )
                      ) 
              );
  </code></pre>
  
  <p>This is the PHP code:</p>
  
  <pre><code>add_action('wp_ajax_shop_ajax_test', 'test_function');
  add_action('wp_ajax_nopriv_shop_ajax_test', 'test_function');
  
  function test_function() {
  check_ajax_referer( 'deshop-ajax-test-nonce' );
  
  
  $response = array( 'what'=&gt;'validate_user_login',
              'action'=&gt;'validate_user_login_results',
              'id'=&gt;'1',
              'data'=&gt;'OK' 
              );
  
  $xmlResponse = new WP_Ajax_Response($response);
  $xmlResponse-&gt;send();
  
  exit();
  }
  </code></pre>
  
  <p>and this is the javascript file:</p>
  
  <pre><code>jQuery(document).ready(function(event) {
  var post = {
                  action: 'shop_ajax_test',
                  _ajax_nonce: ajaxtest.deshopNonce
              };
  
  jQuery.post( ajaxtest.Ajax_Url, post, function(response){
                  var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
                  jQuery.each( res.responses, function() {
                      var a = 0;
                  });
              });
  
  });
  </code></pre>
  
  <p>While debugging the res content shows responses=[0]. In the jQuery.each function no responses are handled!</p>
  
  <p>Thanks a lot for any tips that might help me out here!</p>
  
  <p>Marc</p>