var events = <?php echo $sf_data->getRaw('jsonData'); ?>;//some perfecly fine json
var locations = new Array();
var geocoder = new google.maps.Geocoder();
$(events).each(function(i,e){
geocoder.geocode({address: e.place},function(results,statusCode){
locations[e.id] = results[0].geometry.location;
})
})
alert(locations.length);
Okay, the question is easy. How do i modify the locations array inside of closure? The alert shows 0.
events, before youeach()it. I think we need more code...console.logit's much better for debugging.