Created
October 12, 2015 18:44
-
-
Save jphenow/2b884f8c3643e6c8dc40 to your computer and use it in GitHub Desktop.
Wait for callback to loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queue = [] // build up what you'd be looping through | |
function callAjax(el) { | |
$.ajax(things, { | |
complete: function() { | |
callAjax(queue.shift) | |
} | |
}) | |
} | |
callAjax(queue.shift) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment