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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:52:12+00:00 2026-06-18T21:52:12+00:00

Often times I find myself designing apps that make AJAX calls to the server,

  • 0

Often times I find myself designing apps that make AJAX calls to the server, outside APIs, HTTP requests, etc. The problem is, while this async calls are happening, the user still has the ability to click on items that make the same AJAX call or interrupt the flow of the app, etc. I’ve experimented with various hacks to prevent this, but I’m wondering what the most accepted way of doing this is?

To make this more concrete, let’s say I have a button element that makes an AJAX call and a form element that alters some of the data my app uses for the AJAX call. What is the best way to design the button and form functions so that they do not work while button's AJAX call is in process?

  • 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-18T21:52:13+00:00Added an answer on June 18, 2026 at 9:52 pm

    The best way to accomplish what you want is to lead the AJAX calls trough a function so you can check within that function if a request is active. Here’s an example assuming you’re using JQuery:

    active_ajax_call = false;
    
    function get_ajax(url, senddata) {
        if(active_ajax_call == false) {
            active_ajax_call = true;
            $.ajax({
                type: "POST",
                url: url,
                data: senddata
            }).done(function (data) {
                active_ajax_call = false;
                console.log(data);
            });
        }
    }
    
    get_ajax("some_url", {name: "John", location: "Amsterdam"});
    

    And ofcourse present the website user a nice ajax loader or something so they know data is being pulled.

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

Sidebar

Related Questions

I am not a very orderly person at times and I often find myself
I often find myself using lambdas as some sort of local functions to make
I often find myself reading books and articles that outline patterns, best practices, and
I continuously find myself having to write timed windows services that poll outside queues
I often find myself wanting to copy the contents of arrays that have a
Often times when writing code, I find myself using a value from a particular
Often I find myself needing to write scripts that have to execute some portions
Often times, I find myself navigating very deep into a directory and wanting to
I often find myself asserting that an object isKindOfClass of some class in Objective-C.
I often find myself fighting overengineering -- the person in charge of designing 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.