Skip to content

Instantly share code, notes, and snippets.

@debbbbie
Last active November 1, 2016 05:19
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 debbbbie/bc942f65d9c595e43eeebb5efaddd911 to your computer and use it in GitHub Desktop.
Save debbbbie/bc942f65d9c595e43eeebb5efaddd911 to your computer and use it in GitHub Desktop.
jquery make multi ajax
$.when.apply $, ['/ajax/1','/ajax/2','/ajax/3'].map ->
$.ajax(this)
.done ->
alert('all done')
$.when
$.get('/ajax/1'),
$.get('/ajax/2'),
$.get('/ajax/3')
.done ->
alert('all done')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment