title: Jquery AJAX returning error 500 despite the successful execution on server side
body: <p>I am encountering a problem with codeigniter and JQuery Ajax Post.</p>
  
  <p>My javscript</p>
  
  <pre><code>        $('.remove').click(function(){
          var category=event.target.id;
          var id=$('input[name=article_id]').val();
          var p={};
          p['id']=id;
  
          $.ajax({
              type: "POST",
              url: "/backend.php/blog/removeCategories",
              async:true,
              cache:false,
              data: {id: id, category: category }
              }).done(function(msg){
                  jQuery('#category_list').load('/backend.php/blog/refreshCategories/',p,function(str){});
              });
  </code></pre>
  
  <p>My codeigniter's controller</p>
  
  <pre><code> function removeCategories(){
          $id=$_POST['id'];
          $category_id=$_POST['category'];
  
          $this-&gt;article-&gt;removeCategory($category_id,$id);
      }
  </code></pre>
  
  <p>I can't get the ajax function to work because there is always an error 500 received from the server. Although, firebug returns that there is an error loading the resources, the function removeCategories was executed anyways.  </p>