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

  • Home
  • SEARCH
  • 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 1057145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:49:18+00:00 2026-05-16T17:49:18+00:00

In my jquery admin application I quite often get ajax status lingering, there are

  • 0

In my jquery admin application I quite often get ajax status lingering, there are no errors thrown in the scripts which would half the flow of execution.. I only want to show the bar when there are active ajax requests: Here is the code:

$('#AjaxStatus').ajaxStart(function () {
    $(this).slideUp('fast').delay(1000).slideDown('fast');
});

$('#AjaxStatus').ajaxStop(function () {
    $(this).stop(true, true).slideUp('fast');
});

$('#AjaxStatus').ajaxError(function () {
    $(this).stop(true, true).slideUp('fast');
});

I believe it may be to do with the delay, I only want to show the ajax status though after 1 sec (on faster connection it would be zipping up and down too often)

  • 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-16T17:49:18+00:00Added an answer on May 16, 2026 at 5:49 pm

    Hmm, It is most likely have to do with the delay. I’m not sure what you want to achieve but my guess is that you want the ajax status showing for at least 1 sec even if the requests finishes in time less than 1 sec. If this is correct then you can do something like:

    Edit: This shows only when the requests take longer than 1 sec:

         $('#AjaxStatus').ajaxStart(function () {
             var $elem = $(this)
             $elem.data("inProgress", true); // set flag in progress
             // show status
    
             // check flag every second if the request has finished
             var handle = window.setInterval(function() {
                if($elem.data("inProgress") === true) {
                   if($elem.is(":hidden")) {
                      $elem.slideDown('fast');
                   }
                }else {
                   window.clearInterval($elem.data("handle"));
                   $elem.slideUp('fast');
                }
             }, 1000);
             $elem.data("handle", handle);
         });
    
         $('#AjaxStatus').ajaxStop(function () {
            var $elem = $(this);
            // clear the flag
            $elem.data("inProgress", false);
         });
    
         $('#AjaxStatus').ajaxError(function () {
             $elem.data("inProgress", false);
             window.clearInterval(handle);
         });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Restful Service (from Server) @GET @Produces(application/json) @Consumes(application/json) @Path(/getStatus/) // server:8080/server/rest/admin/status/whatSoEver public void getStatus( @Context
In jQuery, is there a function/plugin which I can use to match a given
I would like to create a fully functional page within my WordPress application (which
I have a rather large application which, on the admin frontend, takes a few
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
Using jQuery, how do you check if there is an option selected in a
I'm quite new to JS and jQuery. I have a problem accessing the properties
I am using Rails and jquery with RJS templates to perform various AJAX requests.
Using the django admin application for a date it displays Today | CalendarSymbol .
I've been fooling around with a very minimalistic jquery admin area menu. The thing

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.