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...
When multiple Deferred objects are passed to jQuery.when, the method returns the Promise from a new "master" Deferred object that tracks the aggregate state of all the Deferreds it has been passed.  The method will either    resolve its mas...
I am currently trying to build a File Uploader using the HTML5 FileAPI. The File Uploader is supposed to handle multiple files and show image previews if the file is an image.  since the FileReader class works asynchronously I want to wait until al...
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 have a situation in which my ajax calls must perform in a particular order. I have used jQuery Deferred objects in other situations, but cannot seem to find a way to make this behave appropriately.  I have a function which performs a number of ajax...
The following snippet will produce an error in Chrome (and Safari) while it works in Firefox.  I'd expect to have 2 numbers shown in javascript console, but in Chrome I only get the first and then an Uncaught TypeError: Illegal invocation    // a...
A quick question on how to use Jquery.deferred to make a slow synchronous function return a promise instead. What I've done so far is this :  function sayIt(ms) {     setTimeout( function() { console.log('what I say'); }, ms); }   functio...
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...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.