title: Jquery ajax is not reaching succes, but don't throw error
body: <p>I have a jQuery ajax request that is not throwing error, but doesn't reach <code>success</code> either.</p>
  
  <p>It looks something like this:</p>
  
  <pre><code> function delete() {
        $("input[name='delete[]']:checked").each(function() {
          console.log($(this).val());
          $.ajax({
            url: 'index.php?route=catalog/product/deleteIndexes&amp;token=&lt;?php echo $token; ?&gt;&amp;order_id=&lt;?php echo $order_id; ?&gt;',
            type: 'post',
            dataType: 'json',
            async: false,
            data: {
              delete_approved: true,
              delete: $(this).val()
            },
  
            success: function(json) {
              if (json['error']) {
                alert(json['error']);
              }
              if (json['success']) {
                alert(json['success']);
              }
            },
  
            error: function (jqXHR, exception) {
              if (jqXHR.status === 0) {
                  alert('Not connect.\n Verify Network.');
              } else if (jqXHR.status == 404) {
                  alert('Requested page not found. [404]');
              } else if (jqXHR.status == 500) {
                  alert('Internal Server Error [500].');
              } else if (exception === 'parsererror') {
                  alert('Requested JSON parse failed.');
              } else if (exception === 'timeout') {
                  alert('Time out error.');
              } else if (exception === 'abort') {
                  alert('Ajax request aborted.');
              } else {
                  alert('Uncaught Error.\n' + jqXHR.responseText);
              }
            }
          });
        });
      }
  </code></pre>
  
  <p>and a function receiving the data:</p>
  
  <pre><code>    public function deleteIndexes() {
        $this-&gt;language-&gt;load('catalog/product');
  
        $json = array();
        if (!$this-&gt;user-&gt;hasPermission('modify', 'catalog/product')) {
          $json['error'] = $this-&gt;language-&gt;get('error_permission');
        } elseif (($this-&gt;request-&gt;server['REQUEST_METHOD'] == 'POST') &amp;&amp; isset($this-&gt;request-&gt;post['delete_approved'])) {
          $this-&gt;load-&gt;model('catalog/product');
  
          $delete = $this-&gt;model_catalog_product-&gt;deleteIndexes($this-&gt;request-&gt;post['delete']);
  
          if ($delete) {
            $json['success'] = $this-&gt;language-&gt;get('error_empty_delete');
          } else {
            $json['error'] = $this-&gt;language-&gt;get('error_empty_delete');
          }
        }
  
        $this-&gt;response-&gt;setOutput(json_encode($json));
      }
  </code></pre>
  
  <p>Am I missing something? It does not reach <code>success</code>, nor does it throw an error. As far as I know, it's one or the other. How is it possible is not reaching either?</p>
  
  <p>I'm using jQuery 1.8.16, and removing the "async: true" doesn't make any change, it just writes to the console the value from the checkbox and then nothing.</p>