Skip to content

Instantly share code, notes, and snippets.

@drewrwilson
Last active August 29, 2015 14:04
Show Gist options
  • Save drewrwilson/5550245110ad1b929132 to your computer and use it in GitHub Desktop.
Save drewrwilson/5550245110ad1b929132 to your computer and use it in GitHub Desktop.
jQuery.ajax({
url: 'example.json',
dataType: "json",
beforeSend: function(){
//do something while the data is loading. eg. $(this).closest('div').html('getting file...');
},
success: function(data) {
window.points = data;
},
complete: function(){
//do stuff after loading points, eg putItOnAMap(window.points.features)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment