title: Magento - Ajax Request - Returns empty response
body: <p>I am debugging some stuff on a client's site that has a module developed by someone else. It's not working correctly.</p>
  
  <p>I have a simple Ajax call to a controller:</p>
  
  <pre><code>jQuery.ajax({
      url : "http://www.site.com/quickview/index/cart",
      complete : function(data){
                      // data.responseText is empty here.
                      jQuery('span.topLinks').replaceWith(data.responseText);
                      // This returns the data object with statusText = "error"
                      console.log(data);
      }
  })
  </code></pre>
  
  <p>Which calls a simple action in the controller:</p>
  
  <pre><code>    public function cartAction()
      {
          // This log call never fires
          Mage::log('foobar',null,'temp.log');
          $this-&gt;loadLayout();
          $Top = $this-&gt;getLayout()-&gt;getBlock('top.links')-&gt;toHtml();
          $this-&gt;getResponse()-&gt;setBody($Top);
      }
  </code></pre>
  
  <p>The problem is that the  Ajax call never makes it to the controller. I have placed a Mage::log call inside the cartAction(), but it never gets fired.</p>
  
  <p>The controller is indeed set up properly, as I can browse directly to cartAction() which will render the block I am attempting to return back to the Ajax call (if I echo it, it's not echoed here).</p>
  
  <p>If I place inside the Ajax call:</p>
  
  <pre><code>console.log(data);
  </code></pre>
  
  <p>It returns the object with  statusText: "error".</p>
  
  <p>I have tried every permutation of the Ajax URL that I can think of, absolute, relative, with index.php, without index.php, etc. Every time, data.responseText is just an empty string.</p>
  
  <p>Any thoughts?</p>