Skip to content

Instantly share code, notes, and snippets.

@opsb
Created March 7, 2014 15:04
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 opsb/9413093 to your computer and use it in GitHub Desktop.
Save opsb/9413093 to your computer and use it in GitHub Desktop.
var getData = function(callback){
showLoadingScreen();
$.ajax("http://someurl.com", {
complete: function(data){
hideLoadingScreen();
callback(data);
}
});
};
var loadData = function(){
getData(doSomethingWithTheData);
}
var doSomethingWithTheData = function(data){
//do something with data
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment