jquery ajax wont return text and or fire alert on error
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1327024/jquery-return-the-value-of-a-ajax-call-to-caller-function">Jquery: Return the value of a ajax call to caller function?</a>  </p>
</blockquote>



<p>In the code below ,</p>

<p>I'm trying to put my ajax call in a function that needs it but makeIt() wont  return "usa from the ajax call ? Or am I going about this all wrong?</p>

<pre><code>var makeIt = function () {
    var getStuff = function () {
        return $.ajax({
          type: "POST",
          url: "my.php",
          data: {
            id: "2"
          },
          success: function (data) {
            data
          }, // data will return string "usa"
          error: function () {
            alert("error");
          }
        });
      };
    return getStuff();
  };
var result = makeIt() //result should = "usa"
</code></pre>
