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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:35:17+00:00 2026-05-25T23:35:17+00:00

Well I have a AJAX calls being performed while I animate some content. I

  • 0

Well I have a AJAX calls being performed while I animate some content.

I want to fire a callback after both are finished successfully?

Any idea?

EDIT: fix typos in the title

  • 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-05-25T23:35:18+00:00Added an answer on May 25, 2026 at 11:35 pm

    This sounds like a good candidate for jQuery Deferred

    Here’s some rough code on how it would work.

    function doAjax(){
       return $.get('foo.htm'); // or $.ajax, $.getJSON.....etc 
    }
    
    function doAnimation(){
       var dfd = $.Deferred();
       $("div").fadeIn(800).delay(1200).fadeOut(300, dfd.resolve);
       return dfd.promise();
    }
    
    $.when( doAjax(), doAnimation() )
     .then(function(){
        console.log( 'I fire once BOTH have completed!' );
     })
     .fail(function(){
        console.log( 'I fire if one or more requests failed.' );
     });
    

    Some references:

    http://api.jquery.com/promise/

    http://www.erichynds.com/jquery/using-deferreds-in-jquery/

    As per some comments i checked to make sure both animation and ajax calls execute in parallel and as expected, they do. http://jsfiddle.net/Gdqfp/4/

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

Sidebar

Related Questions

I have used ajax auto completeextender in my program well its works fine no
I have a small web application with ASP.NET AJAX running well under the Cassini
I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:
I am using the following code to capture all the AJAX calls being made
I want to make AJAX calls to a secure server that uses a self-signed
I have a page in my application that refreshes some content (a list of
I'm running into a problem while running both a Flash socket and using Ajax
I have this site here I have an ajax request that calls a php
well I have a simple text file where I have my textual data filled,
well i have this messages table with sample values like these: msg_id recipient_id read

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.