Hi i have the following.
var g = new Array() ;
$.getJSON(google, function(data) {
var i = 0 ;
$.each(data.items, function() {
var obj = new res(i, this.title, this.snippet, this.formattedUrl, 0) ;
g.push(obj) ;
i=i+1 ;
});
});
I need to be able to access the array outside the async function.
gis in the same scope as thegetJSONcall, then your anonymous function is a closure and already has access tog. If it's not in the same scope, you need to post a more detailed description of your code structure.