I have the following code to go through an obj:
var data = [];
var obj = {...
};
for (var key in obj) {
if (!obj[key]["something"]) {
geocoder.geocode({
'address': key
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
data.push({...});
}
});
// if last item
$.post("...", data, ...);
}
}
Now I want to post all the data retrieved by running all asynchronous functions called in the loop.