Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:17:34+00:00 2026-06-11T18:17:34+00:00

If I create a single Deferred object, then it reports progress like I would

  • 0

If I create a single Deferred object, then it reports progress like I would expect.

var d1 = function() {
    var d = $.Deferred();
    d.notify('d1');
    d.resolve('d1');
    return d.promise();
};

d1().progress(function(a) {
    log('Progress: ' + a);
});

​
However, if I chain two Deferred objects using then(), the progress callbacks are not called.

d1().then(d1).progress(function(a) {
    log('Progress: ' + a);
});

It seems to me that then() should propagate the progress notification, but it doesn’t appear to be the case. Am I missing something?

I have tested this with jQuery 1.8.0 and 1.8.1. A full working example is here: http://jsfiddle.net/eWQuG/13/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:17:36+00:00Added an answer on June 11, 2026 at 6:17 pm

    I can see what’s going on but it’s slightly tricky to explain. You may have to read this through a couple of times …

    In Test 1, the promise passed to test() is the “original promise” ie. the object returned by d1(). Simple.

    In Test 2, the object passed to test() is a new promise resulting from d1().then(d2).then(d3). Less simple. This new promise will have inherited only some of the original promise’s properties – not including its progressCallbacks (as put in place in the original promise with notify()). This is reasonable for a promise returned by .then(), because .then() is designed to put in place its own doneCallbacks, failCallbacks and progressCallbacks, not to propagate those of the deferred/promise to its immediate left. In short, .then() does exactly what its name implies – it specifies what is to be done after its preceding deferred/promise has been processed.

    You can better see what’s going on by keeping a reference to the original promise (ie. the output of d1()), thus allowing the simple Test 1 to be run both before and after Test 2.

    Here is a composite Test 3 :

    log('-- Test 3 --');
    var p = d1();//p is a promise
    test(p);//equivalent to Test 1
    test(p.then(d2).then(d3));//equivalent to Test 2
    test(p);//equivalent to Test 1 again
    

    DEMO

    In the log, you will see that the behaviour of test(p) is identical in both cases. However, test(p.then(d2).then(d3)) behaves differently because the object passed is no longer the original promise but a new promise with no progressCallbacks.

    EDIT

    Ryan, something maybe worth considering in achieving what you want with :

    d1().then(d2).progress(function(a) {
        log('Progress: ' + a);
    });
    

    is that a the chain can be rearranged as follows :

    d1().progress(function(a) {
        log('Progress: ' + a);
    }).then(d2);
    

    The progress callback is thus applied to the original promise and because .progress() propagates the original promise down the chain, .then() will still act as before.

    Both versions are valid but would be applicable in different circumstances.

    If I’m right then maybe this is the short answer to your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a single URL that returns one image when loaded
Is it possible to create the single instance of COM object, and be sure
I can create a single aggregate projection on a collection of entities example Return
If i create a singleton class then only one object of that class can
My goal is to create a single object in powershell that shows the AD
I want to create a single video file from multiple video files (parts). I
I want to create a single button which serves both functions of Starting and
I tried to create a single insert query for the values in template_list array.
I need to create a single trace file that spans several days for one
I hope to create a single app that supports both the iPhone and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.