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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:42:37+00:00 2026-06-14T20:42:37+00:00

I have a function in a web application that makes an AJAX call to

  • 0

I have a function in a web application that makes an AJAX call to update an element. I have other functions which use this function, and other functions which use those functions.

Say I have function A which makes an AJAX call. Function B calls function A, and function C calls function B.

Now imagine I have function D, which is another function that makes an AJAX call.

I want to call function C, then function D. The problem is I run into an issue where sometimes function D is using the response that was returned from the function C call. So I don’t want function D to run until a response is received from function C’s AJAX request.

Since the AJAX request happens so far down the chain (C > B > A), it seems like such a hack to have function C accept a callback, then pass that call back to B, which passes that callback to A so that A can call that callback function after it receives the response to it’s AJAX request.

Is this actually the best way to do it, or can it be done more cleanly? If it makes a difference, I’d prefer a solution that doesn’t use any extra libraries (like jQuery for example.)

Thanks a lot for any help.

  • 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-14T20:42:38+00:00Added an answer on June 14, 2026 at 8:42 pm

    You want to use promise pattern.

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

Sidebar

Related Questions

I have this ajax web application I am developing that essentially calls the google
I have a web application that functions as a dashboard, allowing a user to
I'm creating a web application which loads tabs using AJAX. My problem is that
I am developing an asp.net mvc web application that makes much use of jquery
So I'm building a web application and I have an ajax request that pings
I have an ASP.Net MVC 3 application that uses a jQuery .ajax call to
I am working on a web application that makes heavy use of grids with
We have a web application where you can access two services/functions (Buy and Rent).
I have a web application with multiple WARS. These WARS all perform different functions
I have a function(please see code below) which reads some data from the web.

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.