Possible Duplicate:
How can I get jQuery to perform a synchronous, rather than asynchronous, AJAX request?
Get a variable after ajax done
The two alert functions in the following code returns different results. I am trying to get the second to evaluate true too.. Any help is appreciated.. Thanks..
var array;
$.get('php/getstocklist.php', function(data){
array = data;
alert($.isArray(array)); //alerts true
}, "json");
alert($.isArray(array)); //alerts false