title: Return data after ajax call success
body: <p>I try to get data after success ajax but it is not work correctly, please help me.</p>
  
  <pre><code>var aid='11111111V';
  var dch=0;
    $.ajax({
    type:"POST",
    url:"new_hpa_fun_aplcval.php",
    data:"aid="+aid,
    success: function(msg){
        if (msg=='OK'){
            dch=1;                    
        }else{
            dch=2;
        }
    }
    });
  
  alert(dch);
  </code></pre>