title: jquery ajax: request failed
body: <p>i wan't to run a jquery but when i run it i first get my value and then the code failed error. What does this mean? Here you can find my json en ajax file. It seems that the json won't go to my ajax file.  </p>
  
  <pre><code>$("#submit_tosolve").on("click",function(e){
       //data uitlezen
      alert("ok");
      var message =$("#bugcommentaar").val();
      console.log(message);
      alert("ok");
      //data naar database sturen
  
      var request = $.ajax({
        url: "ajax/facebook_ajax.php",
        type: "POST",
        data: {message : message}, //JSON
        dataType: "json"
      });
  
      request.done(function(msg) {
      if(msg.status=="success"){
  
        var update='&lt;div style="display:none;" class="span4"&gt;'+
        ' &lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;h5&gt;&lt;p&gt;'+ message+'comment posted &lt;/p&gt;&lt;/h5&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;';
  
  
      $("#singleBug table").prepend(update);
      $("#singleBug table tr td").first().slideDown(); //dit gaat werken op elke browser, de eerste eruit halen
  
  
  
        }
      });
  
      request.fail(function(jqXHR, textStatus) {
        console.log("request failed" +textStatus);
      });
  
  
      });
  </code></pre>
  
  <p>my ajax file :</p>
  
  <pre><code>&lt;?php
      include_once("../classes/Bug.class.php");
  
          $feedback=array();
          if(isset($_POST['message'])) 
          {
              try
              {
                  $Bug = new Bug();
                  $Bug-&gt;Commentaar=$_POST['message'];
                  $Bug-&gt;Bug_id=$_SESSION['id2sessioncommentaar'];
                  $Bug-&gt;UpdateCommentaar();   
                  $feedback['text'] = "Your comment has been posted!";
                  $feedback['status'] = "success";
              }
              catch(Exception $e)
              {
                  $feedback['text'] = $e-&gt;getMessage();
                  $feedback['status'] = "error";
              }
  
              header('Content-Type: application/json' );
              echo json_encode($feedback);
  
  
          }
  
  
  ?&gt;
  </code></pre>