//if we make a successful request and it returns an address
if(this.status==200){
//get formatted address from https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding
//var result = JSON.parse(xhr.responseText).contents.results[0].formatted_address;
console.log(result.results[0]['formatted_address']);
alert(result.results[0]['formatted_address']);
} else {
//send some general error