title: jquery ajax success functions not executing
body: <p>I have a modal dialog form that submits data to a table.  I want to give the user some feedback on the success/failure of the submission, but the success handlers aren't firing.</p>
  
  <p>My code is</p>
  
  <pre><code>$.ajax({
    type: "POST",
    url: "includes/phpscripts.php?action=submitWiki",
    data: {"name": location, "location": locationName, "text": locationText, "user": userId},
    beforeSend: function(x){
      if (x &amp;&amp; x.overrideMimeType){
        x.overrideMimeType("application/json;charset=UTF-8");
      }
    },
    async: false
  }).done(function(data){
    if (data == "failure"){
      $("#submissionFailure").dialog("open");
    } else {
      $("#submissionSuccess").dialog("open");
      var count= 3;
      var id= setInterval(function(){
        count--;
        if (count == 0)
          $("#submissionSuccess").dialog("close");
      }, 1000);
    }
  });
  </code></pre>
  
  <p>Another version had the if/else block within <code>done</code> defined as  </p>
  
  <pre><code>success: function(data){
    if (data == "failure"){
      $("#submissionFailure").dialog("open");
    } else {
      $("#submissionSuccess").dialog("open");
      var count= 3;
      var id= setInterval(function(){
        count--;
        if (count == 0)
          $("#submissionSuccess").dialog("close");
      }, 1000);
    }
  }
  </code></pre>
  
  <p>In Firebug, I can clearly see the return from the request is <code>success</code> due to an echo statement, but the success function is getting skipped over.  I've set the breakpoint directly on the <code>done</code> line, and everything gets skipped over.</p>
  
  <p>In addition, the posts are being recorded into the database.</p>