title: Jquery ajax request with async:true does not return value
body: <p>With async:set to false, the function is returning the correct value. However it blocks the browser. I've tried to add callbacks but it not returning the correct value!</p>
  
  <pre><code>function find_route(array_bustops){
          var myresults;
              $.ajax({
  
              type: 'POST',
                  async: true,  //with async:false it works
              url: 'find_routenum.php',
  
              data:{
  
                  array_bustops:JSON.stringify(array_bustops)
  
              },
              dataType:'json', //html,xml
  
              success: function(my_results){
  
                  myresults=my_results;
  
  
              },
  
              error:function(x,e){
                  if(x.status==0){
                  alert('You are offline!!\n Please Check Your Network.');
                  }else if(x.status==404){
                  alert('Requested URL not found.');
  
              }
  
  
          });
  
          return myresults;
      }
  </code></pre>
  
  <p>WITH CALLBACK:</p>
  
  <pre><code>function find_route(array_bustops,callback){
          var myresults;
              $.ajax({
  
              type: 'POST',
                  async: true,  //with async:false it works
              url: 'find_routenum.php',
  
              data:{
  
                  array_bustops:JSON.stringify(array_bustops)
  
              },
              dataType:'json', //html,xml
  
              success: function(my_results){
  
                  callback(array_bustops,my_results)
  
  
              },
  
              error:function(x,e){
                  if(x.status==0){
                  alert('You are offline!!\n Please Check Your Network.');
                  }else if(x.status==404){
                  alert('Requested URL not found.');
  
              }
  
  
          });
  
          return myresults;
      }
      function find_route2(myresults){
             return myresults;
      }
  </code></pre>
  
  <p>And then i call the function as follows:</p>
  
  <pre><code>arr_one=find_route(arr,find_route2)
  </code></pre>
  
  <p>but arr_one returns undefined.</p>
  
  <p>EDIT: it still is not working with async:set to true</p>