title: why cant I return data from $.post (jquery)
body: <p>I must be making a silly mistake but I cannot return the data I get from a $.post function and store it in a variable, not only that, I cannot return ANYTHING from within that function. Example:</p>
  
  <pre><code>function test(){
  
  $.post("demo_test_post.asp",
      {
        name:"Donald Duck",
        city:"Duckburg"
      },
      function(data,status){
        return(data)
      });
  
  }
  
  var foo = test()
  alert(foo)
  </code></pre>
  
  <p>it say's that foo is undefined. But to take it a step further, even when I do this:</p>
  
  <pre><code>function test(){
  
      $.post("demo_test_post.asp",
          {
            name:"Donald Duck",
            city:"Duckburg"
          },
          function(data,status){
  
            var bar = "bar"
            return(bar)
          });
  
      }
  
      var foo = test()
      alert(foo)
  </code></pre>
  
  <p>it STILL says foo is undefined... I must be doing something wrong or misunderstanding something. Can someone please help.</p>
  
  <p>Thanks</p>