Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created October 31, 2014 15:22
Show Gist options
  • Save leejarvis/f887904d26f7f34c41e5 to your computer and use it in GitHub Desktop.
Save leejarvis/f887904d26f7f34c41e5 to your computer and use it in GitHub Desktop.
onClick: (e) ->
reqs = []
$(...).find(...).each (i, el) =>
req = $.ajax
url: $(el).data('path')
success: (content) =>
files[$(el).data('name')] = content
reqs.push(req)
$.when.apply(null, reqs).done =>
finish(files)
finish: (files) =>
console.log files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment