102
rated 0 times
[
103]
[
1]
/ answers: 1 / hits: 32272
/ 15 Years ago, fri, november 13, 2009, 12:00:00
I have a problem returning a variable in my function, the below script works fine:
function sessionStatus(){
$(document).ready(function(){
$.getJSON(scriptRoot+sessionStatus.php,function(status){
alert(status);
});
});
}
sessionStatus();
Bet when I try the following I get a message box with the message undefined:
function sessionStatus(){
$(document).ready(function(){
$.getJSON(scriptRoot+sessionStatus.php,function(status){
return status;
});
});
}
alert(sessionStatus());
This is really bugging me, I just can't seem to see what I've done wrong.
More From » function