jQuery 1.5 brings the new Deferred object and the attached methods .when, .Deferred and ._Deferred.  For those who haven't used .Deferred before, I've annotated the source for it.  What are the possible usages of these new methods, how do w...
I'm getting an unexpected result when using $.when() when one of the deferred operations does not succeed.  Take this JavaScript, which created 2 deferreds. The first one succeeds and the second one fails.   var f1 = function() {     return $.Def...
I want to send [1, n) AJAX-requests to the server and after all have returned a result a modal dialog should be closed. $.when(a(), b(), c()) would be perfect, but I don't know how to pass the variable count of functions to $.when as parameter. A...
Code example: http://jsfiddle.net/MhEPw/1/  I have two jQuery Deferred objects.  I want to have more than one 'async' request happening - and after they all run I want the callbacks (the .done functions) to be run in order they were specified...
I'm building a game with move.js for animation, but it takes too long so when the player click on the right solution it displays the winning message before the right solution change it's color, so I used deferred object to fire an event and c...
I have a function to get some data, and the function should return a promise. In the function, I have to made 2 requests - one after another. I ended up with a nested deferrer call where the last call resolves on the deferrer the function will return...
A while ago, a SO user wrote this function for me to return a variable number of jQuery $.get() requests. The first part is pretty straightforward, but will someone elplain how $.when(), apply(), and $.done() are interacting. I don't understand i...
I have a function that accepts a callback function where I pass the data back in. Can this converted to a deferred object for better practice?  Here is what I got:      var chapters;     var getChapters = function (fnLoad) {         //CACHE DATA IF A...
I've been puzzling for quite a while trying to wrap my head around JavaScript promises. I want to fix some issues with asynchroneous calls in my code, to de-spagethise it. But I'd love for an expert to help me, because I've wasted quite s...
EDIT: IMPORTANT NOTE this is using jQuery 1.7.2, and no it cannot be changed from this version  I'm new to promises and trying to wrap my head around them. I'm trying to execute a series of functions in order, waiting for them to complete bef...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.