[jQuery] .get, callback function and scope. Is this possible?
I'm receiving a string of text back in a .get call:
I can alert the "result" variable while within the callback portion of
the .get call.
$.get("ajax.cfm",function(result){
// callback body
alert(result);
});
But I'd like to somehow be able to get that result variable outside
the callback like so:
$.get("ajax.cfm",function(result){
// callback body
});
alert(result);
But it doesn't seem to be working. Surely .get has to be able to
interact with scope outside of itself. Am I missing something?