Why won't this jQuery function perform properly? (Revised)
<p>(Didn't mean to create a new question, but revised the <a href="http://stackoverflow.com/questions/928090/why-wont-this-jquery-function-perform-properly">old one</a> enough that the answers don't make sense, and now there's a new problem)</p>

<p>I'm a total noob when it comes to jQuery but I am trying to learn. What in tarnation am I doing wrong here?</p>

<pre><code>function MakeCall(url) { 
var result;
$.ajax({
    url: url,
    dataType: "text",
    success: function(txt) {
        result = txt;
        alert(result);
        return;
    }
});
alert(result);
return result;
}
</code></pre>

<p>my problem is that the first alert returns the correct value, but the second alert is returning "undefined" and it pops up BEFORE the first alert, even though the result is getting set properly in the success function... sigh... what am I doing wrong? :(</p>

<p>Thanks so much...</p>
