Skip to content

Instantly share code, notes, and snippets.

@lucagrulla
Created September 25, 2011 16: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 lucagrulla/1240760 to your computer and use it in GitHub Desktop.
Save lucagrulla/1240760 to your computer and use it in GitHub Desktop.
Mark-initial-problem
//for the original blog post check
//http://www.markhneedham.com/blog/2011/09/25/jquery-collecting-the-results-from-a-collection-of-asynchronous-requests/
var people = ["Marc", "Liz", "Ken", "Duncan", "Uday", "Mark", "Charles"];
var grid = [];
$.each(people, function(index, person) {
$.getJSON('/git/pairs/' + person, function(data) {
// parse data and create somethingCool
grid.push(somethingCool);
});
});
// do something with grid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment