title: jquery ajax retrieve value from plain/text
body: <p>I'm stuck with following problem.</p>
  
  <p>A page requests user and password. If an user and his password exists, the page outputs just a plain 1. Otherwise a 0.</p>
  
  <p>How do I check this with jquery ajax and process it further depending on the output?</p>
  
  <pre><code>$(function () {
  
  $("#checkCode").click(function () {
  
      var var_pCode = $("#ctl00_ContentPlaceHolder1_tbPartner").val();
      var var_cCode = $("#ctl00_ContentPlaceHolder1_tbCode").val();
      var myResult
  
  
      $.ajax({
          url: "codeValidator.aspx",
          dataType: "text",
          data: { pCode: var_pCode, cCode: var_cCode }
      }).done(function (msg) {
          //alert(msg);
          if (msg = "1") { alert('111'); }
          else {alert('000')}
      });
  
  
  });
  </code></pre>
  
  <p>});</p>
  
  <p>thanks in advance</p>