title: jquery ajax returns error but is success
body: <p>I have the following JS</p>
  
  <pre><code>function change_ajaxarea1(){
  navigator.notification.activityStart();
  $('#ajaxarea1').load('http://server.net/droiddev/backbone1/index.php/welcome/', function(){
  
  navigator.notification.activityStop();
  $('#ajaxarea1').css("height","auto");
  //$('#ajaxarea1').css("overflow","hidden");
  });
  
  //navigator.notification.activityStart();
  }
  
  
  function postarticle(){
  
   $.post("http://server.net/droiddev/backbone1/", { headline: "John", article: "2pm" } );
  
   }
  
  
  function addarticle(){
  
  var headlinetemp=$('#headline').val();
  var articletemp=$('#article').val();
  $.ajax({
  type:'POST',
  dataType:'json',
  url: "http://server.net/droiddev/backbone1/index.php/welcome/addarticle/",
  data: { 'headline': headlinetemp, 'article': articletemp},
  success:function(){
  alert('success');
  },
  error:function(xhr){
  alert(xhr.status);
  }
  
  
  
  });
  
  
  
  }
  </code></pre>
  
  <p>and the following controller code :</p>
  
  <pre><code>  &lt;?php 
  
  class Welcome extends CI_Controller {
  
  
      public function index()
      {
  
      $data['query']=$this-&gt;site_model-&gt;get_last_ten_articles();
  $this-&gt;load-&gt;view('partial1',$data);
  
      }
  
      public function addarticle(){
  
      $headline=$this-&gt;input-&gt;post('headline');
      $article=$this-&gt;input-&gt;post('article');
      $this-&gt;site_model-&gt;insert_entry($headline,$article);
  
  
  
      }
  }
  </code></pre>
  
  <p>The addarticle() javascript ajax works and posts the vars to the server and into the db, however, javascript will then run the error function instead of the success function. The http response code is 200 which I thought would make it run the Success function. any suggestions?</p>