Skip to content

Instantly share code, notes, and snippets.

@akumpf
Last active December 11, 2015 00:09
Show Gist options
  • Save akumpf/4514343 to your computer and use it in GitHub Desktop.
Save akumpf/4514343 to your computer and use it in GitHub Desktop.
(function(){
var i = 0;
function forloop(){
if(i<5){
$.getJSON('/data'+i+'.json', function(data) {
console.log("yay! Data"+i+" is ready!");
i++;
forloop();
});
}else{
console.log("all done");
}
}
forloop();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment