Help with AJAX Promises/Deferred
I'm looking for a small JS library for Promises/Defers for multiple AJAX requests that I can use with MooTools. All of the ones that I can 开发者_运维知识库find all have setTimeout functions as their examples, which don't show me how I can use the resulting JSON and/or HTML in the Deferred callback that is fired when all of the requests are finished.
Can anyone point me in the right direction?
if it's a queue of requests, have you looked at either using this: http://mootools.net/docs/more/Request/Request.Queue or extending it somewhat?
the difference between deferred normal tasks (that are sync) and deferred async is in that you need to intercept the onComplete events of the requests to notify the task handler that it's finished and then pass them on to the original onComplete assigned.
Not sure whether you are looking for a small Deferred implementation such as https://gist.github.com/3672350
精彩评论