deferred « callback « jQuery Q&A

Home
jQuery Q&A
1.addClass
2.alert
3.array
4.attribute
5.browser
6.callback
7.clone
8.Cookie
9.Date
10.Development
11.document
12.dom
13.element
14.filter
15.Firefox
16.flash
17.format
18.html
19.input
20.internet explorer
21.json
22.mootools
23.page
24.performance
25.regex
26.safari
27.selector
28.setTimeout
29.String
30.table
31.Text
32.trigger
33.URL
34.video
35.xml
jQuery Q&A » callback » deferred 

1. jQuery.Deferred "then" callback giving unexpected behavior    stackoverflow.com

It seems as if the "then" callback is not firing when a Deferred object is "rejected". It was my understanding "then" should be executed whether the Deferred resolves or rejects. Here ...

2. Can you stop a defered callback in jquery 1.5?    stackoverflow.com

I am wondering say you have something like this

// Assign handlers immediately after making the request,
// and remember the jqxhr object for this request
var jqxhr = $.ajax({ url: "example.php" })
  ...

3. How do you attach callbacks to the deferred object that is attached to a deferred object?    stackoverflow.com

I have a chain of ajax requests that support a series of cascading drop down select lists. When you select a value in the 1st drop down, a request is fired ...

4. jQuery.when - Callback for when ALL Deferreds are no long 'unresolved' (either resolved or rejected)?    stackoverflow.com

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 ...

5. jquery when custom wrapper functions?    stackoverflow.com

I have a custom wrapper function around jquery ajax.

custom.get = function (path, callback) {
  // do other things
  $.get(path, function () {
    callback()
  })
}
doing
$.when(custom.get(path), custom.get(path)).done(function ...

6. jQuery Deferred object callback args & dynamically building?    stackoverflow.com

I saw this code at jQeury Site :

 1:  var jqxhr = $.ajax( "example.php" )
        .done(function() { alert("success"); })
    ...

7. html5 executeSql callbacks vs jQuery deferred    stackoverflow.com

The html5 spec for executeSql includes a success callback and a fail callback:

db.transaction(function(tx) {    
    tx.executeSql('SELECT * FROM MyTable WHERE CategoryField = ?', 
  ...

8. Deferred callback list behavior and 'stopOnFalse'    forum.jquery.com

I am using deferreds in a public API as the return values for methods that spawn AJAX requests. This has a number of advantages, most notably allowing users of the API to respond to both success and error states of the request in an elegant manner. However I've been facing one major issue with this pattern: there is default behavior that ...

11. Problem with $.Deferred "then" callback    forum.jquery.com

12. How to hook a single callback to both deferred.done and deferred.fail?    forum.jquery.com

I've been coding some deferred objects which wrap an AJAX call, but where I need $.ajax's ".complete()" functionality too. As I have to create my own $.Deferred to return to the caller I have to replicate the way that $.ajax creates a separate deferred object that's only used to signify completion.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.