title: Success function does not return data using ajax
body: <p>The success function does not give results. How do I solve this?</p>
  
  <p>I have the following code </p>
  
  <pre><code>function fun()
  {
    var list_target_id = 'year';
    $.ajax({
      url: '://localhost/htdocs/cscart_mutli_car/index.php?dispatch=drill.drill',
      dataType: 'json',
      success: function (data) {
        alert(data);
      },
      error: function (xhr, status, error) {
        alert(xhr.responseText);
      }
    });
  }
  
  
  
  if ($mode == 'drill')
  {
    $id = 166;
    $arr = array('category_id' = &gt; 167, 'category' = &gt; 'computers');
    echojson_encode($arr);
    exit;
  }
  </code></pre>
  
  <p>Here in this <strong>Ajax</strong> I get the success alert. But it <strong>does not provide any results</strong>. How do I solve this?</p>