Skip to content

Instantly share code, notes, and snippets.

@mikekavouras
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save mikekavouras/c9bb92a4e79e230710a5 to your computer and use it in GitHub Desktop.

Select an option

Save mikekavouras/c9bb92a4e79e230710a5 to your computer and use it in GitHub Desktop.
function gimmeDatJSON(callback) {
$.getJSON(geourl, function(response) {
callback(response);
});
}
function processResponse(response) {
var lat = response.results[0].geometry.location.lat;
var lng = response.results[0].geometry.location.lng;
// do something with lat & lng
}
$('#submit').bind('click', function() {
gimmeDatJSON(function(response) {
processResponse(response);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment