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 9255959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:49:42+00:00 2026-06-18T11:49:42+00:00

How can I set a Deffered from resolved back to the initial state? I

  • 0

How can I set a Deffered from resolved back to the initial state?

I tried creating a new Queue, but in that case I will lose all events I have added so far, If I don’t resolve it first.

Is there maybe a state model of the Deferred (Processing –> Resolved… maybe something in between, how you can get from Resolved into Processing….)

This is what I have so far:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Demo</title>
    <script src="jquery-1.8.3.min.js"></script>
    <script>
        var deferredReady = jQuery.Deferred();

        $(function () {
            $('#Queue1, #Queue2').click(function () {
                var text = $(this).text();
                deferredReady.done(function () {
                    $('<p>', {
                        text: text
                    }).appendTo('body');
                });
            });
            $('#QueueReady').click(function () {
                deferredReady.resolve();
            });
            $('#NewQueue').click(function () {
                // deletes the old queue (resolve it first)
                deferredReady = jQuery.Deferred();
            });
        });
    </script>
</head>
<body>
    <button id="Queue1">Add Comamnd to ready Queue</button>
    <button id="Queue2">Add  otherComamnd to ready Queue</button>
    <button id="QueueReady">Set Queue to ready</button>
    <button id="NewQueue">Set Queue to ready</button>
</body>
</html>
  • 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-18T11:49:44+00:00Added an answer on June 18, 2026 at 11:49 am

    No, this conctraticts the original intent of deferred objects. As soon as a Deferred is resolved or rejected, previously specified callbacks are called and the Deferred changes irrevocably from its initial “pending” state to either “resolved” or “rejected”. What would you expect from setting it back to the initial state? If you want to add a new handler to a deferred object which may or may not be already resolved, this is not a problem. The handler will be called immediately:

    $.Deferred().resolve().then(function() { alert('This works!'); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that we can set the various style attributes from code behind using
I can set the ToolTip property of a ListView control, but that's for the
How can set self.navigationItem.backBarButtonItem of my RootViewController , so that the back button is
I can :set number from within a file I'm editing but how can I
You can set the initial size for an ArrayList by doing ArrayList<Integer> arr=new ArrayList<Integer>(10);
I can set the background of each TabItem with TabItem.Background, but when that tab
You can set the Vim color scheme by issuing :colorscheme SCHEME_NAME but, oddly enough,
In Photoshop you can set a layer's blending mode to be Hue. If that
I can set these values in the initial options object and everything works fine.
I can set up an autofilter using pyWin32, but I wondered if it's possible

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.