(Didn't mean to create a new question, but revised the old one enough that the answers don't make sense, and now there's a new problem)
I'm a total noob when it comes to jQuery but I am trying to learn. What in tarnation am I doing wrong here?
function MakeCall(url) {
var result;
$.ajax({
url: url,
dataType: "text",
success: function(txt) {
result = txt;
alert(result);
return;
}
});
alert(result);
return result;
}
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? :(
Thanks so much...