$.get("test.php",function(result){
var data = result;
});
alert(data);
test.php do one thing only
<? echo "ABC"; ?>
this script always return 'ReferenceError: data is not defined' error
i tried to declare var data="";
before $.get but the value of data did not changed after $.get. this method can works in common function.
i also tried to use window.data=result
to made data global but nothing changed.
what is wrong?