title: Wordpress Ajax returning 0
body: <p>I hope you can help.
  The following code in functions.php is returning 0.</p>
  
  <pre><code>function removeItems(){
  echo "hello";
  die();
  }
  
  add_action('wp_ajax_removeItem', 'removeItems');
  add_action('wp_ajax_nopriv_removeItem', 'removeItems'); 
  
  function remove_item(){
    echo '&lt;script type="text/javascript"&gt;
      jQuery(document).ready(function(){
          jQuery("body").delegate(".remove_one","click",function(){
              var cart_key = jQuery(this).data("cart_key");
              jQuery.ajax({
                  type:"POST",
                  url: "/wp-admin/admin-ajax.php",
                  data: {action: "removeItem"},
                  success:function(data){
                      alert(data);
                  }
              });
          });
      });
  &lt;/script&gt;';
  }
  
  add_action('wp_head', 'remove_item');
  </code></pre>
  
  <p>The common error I can find is not including:</p>
  
  <pre><code>add_action('wp_ajax_nopriv_removeItem', 'removeItems'); 
  </code></pre>
  
  <p>...but I've added that in.</p>
  
  <pre><code>action=removeItem
  </code></pre>
  
  <p>is being added in the console.</p>
  
  <p>Any help would be much appreciated.
  Mark</p>