title: whats wrong with this ajax function?
body: <p>This is my ajax function and</p>
  
  <pre><code>$('#save_form_3').button({
      icons: {
          primary: "ui-icon-disk"
      }
  })
  .click(function (event) {
      if($('#guarantor_details').validate().form()){
      var form_3_data = $("#guarantor_details").serialize();
      $.ajax({
              type: "POST",
              url: "insert.php",
              data: form_3_data,
              success: function(response, textStatus, xhr) {
                  alert(response);
                  if(response=="success"){
                      alert(response);
                  }
              },
              error: function(xhr, textStatus, errorThrown) {
  
              }
      });     
      return false;       
      }
  });
  </code></pre>
  
  <p>first alert gives me message "success" and second alert doesn't execute. seems like if condition not working under success function.</p>
  
  <p>any idea why it doesn't?</p>
  
  <p>im using jquery-1.6.2.min.js.</p>
  
  <p>maybe problem in jquery 1.6.2 or am i doing something wrong?</p>
  
  <p>Thanks</p>
  
  <pre><code>if($SQL_INSERT){
      echo "success";
  }else{
      echo mysql_error(); 
  } 
  </code></pre>
  
  <p>thats insert.php anyway </p>
  
  <p><code>if($.trim(response)=="success")</code> works</p>