ajax success response issue
<p>I am having an issue with the ajax jquery function.  This is may javascript code:</p>

<pre><code>$.ajax({
  type: "POST",
  url: "login.php",
  data: {
    username: username,
    password: password
  },
  dataType: "text",
  contentType: "application/x-www-form-urlencoded;charset=ISO-8859-15",
  success: function (msg) {
    $("#button").ajaxComplete(function (event, request) {
      alert(msg == 'ok');
      if (msg == 'ok') {
        $('#load').show();
        setTimeout(function () {
          $("#username").css("background", "green");
          $("#password").css("background", "green"); // add red  color 
        }, 1000)
        setTimeout("submitForm()", 2000);
      } else {
        $('#load').show();
        setTimeout(function () {
          $("#username").css("background", "red");
          $("#password").css("background", "red"); // add red  color
          $('#load').hide();
          $('#button').show();
        }, 1000);
      }
    });
  }
});
</code></pre>

<p>I don't understand why the if(msg=="ok") return false,even if in the object "msg" there is a string "ok".</p>
