Skip to content

Instantly share code, notes, and snippets.

@akumpf
Created January 11, 2013 22:03
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 akumpf/4514327 to your computer and use it in GitHub Desktop.
Save akumpf/4514327 to your computer and use it in GitHub Desktop.
$.getJSON('/data0.json', function(data) {
console.log("yay! Data0 is ready!");
// ok, now use that to get the next piece of data.
$.getJSON('/data1.json', function(data) {
console.log("yay! Data1 is ready!");
// ok, now use that to get the next piece of data.
$.getJSON('/data2.json', function(data) {
console.log("yay! Data2 is ready!");
// ok, now use that to get the next piece of data.
$.getJSON('/data3.json', function(data) {
console.log("yay! Data3 is ready!");
// ok, now use that to get the next piece of data.
$.getJSON('/data4.json', function(data) {
console.log("yay! Data4 is ready!");
// Whew... we have all 5 pieces of data.
console.log("all done.");
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment