Skip to content

Instantly share code, notes, and snippets.

@paulakreuger
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulakreuger/9930243 to your computer and use it in GitHub Desktop.
Save paulakreuger/9930243 to your computer and use it in GitHub Desktop.
Get Json Data
/*
==GET JSON DATA
-----------------------------------------------------*/
function getData(url, callback, errorCallback, completeCallback) {
$.getJSON(url, function (data) {
log('success');
log(data);
callback(data);
}).error(function (data) {
log('error');
log(data);
errorCallback(data);
}).complete(function (data) {
log('complete');
completeCallback(data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment