title: Handling Ajax request feedback
body: <p>After I've done a MySQL operation I have the following lines of code (I've tried each one of them):</p>
  
  <pre><code>if($done){
    echo json_encode("done");
    flush();
  }
  
  if($done){
    echo "done";
  }
  </code></pre>
  
  <p>and in the Javascript side I have:</p>
  
  <pre><code>done(function(data) {
      if(data){
          alert(data);
          console.log(data=="done");
  </code></pre>
  
  <p>Although the data appears correctly in the alert, the "console.log" always displays false. I've tried without the <em>" "</em> and with <em>' " " '</em> and what else but it just won't work. Any idea on why?</p>