title: WordPress AJAX call refuses to return data
body: <p>I'm trying to return some meta data once a select field changes.  However, I've done several iterations of the code below, and it works fine if I simply echo it from a php script, but when I try to return it as a response, it fails. I know that it's definitely running the function because if I simply tell it to 'echo 'xxxx', it works. Below is the code I'm attempting to implement.  I'm completely stumped and hope I'm simply overlooking something... </p>
  
  <pre><code>add_action('admin_footer', 'get_criteria_javascript');
  
  function get_criteria_javascript() {
  ?&gt;
  &lt;script type="text/javascript"&gt;
  jQuery(document).ready(function($) {
      if(jQuery('select#pages').length &gt; 0) {
          jQuery('select#pages').live('change', function() {
              var selected = jQuery(this).val();
              var data = { action: 'get_criteria', post_id: selected };
  
              jQuery.ajax({
                  type: 'post',
                  dataType: 'html',
                  url: 'admin-ajax.php',
                  data: {action: 'get_criteria', post_id : selected },
                  success: function(response) {
                      alert(response);
                  }
              });
          });
      }
  });
  &lt;/script&gt;
  &lt;?php
  }
  
  add_action('wp_ajax_get_criteria', 'get_criteria_callback');
  
  // if I use echo get_criteria_callback(627); here, it returns the expected results... 
  
  function get_criteria_callback($post_id) {
      $meta = get_post_meta($post_id, 'criteria');
      $content = implode(', ', $meta[0]); 
  /* This is one version. Although I can echo it fine, if I return this as a response, it tells me my implode is using invalid arguments */
  
      echo $content;
      die();
   }
  </code></pre>