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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:29:10+00:00 2026-06-12T00:29:10+00:00

I have the following script which works fairly nicely to show when ajax stuff

  • 0

I have the following script which works fairly nicely to show when ajax stuff is loading:

$("#divLoading").ajaxStart(function () {
    $('#divLoading').show();
});

$("#divLoading").ajaxComplete(function () {
    $('#divLoading').hide();
});

However, this seems to start with a delay after a click event and ends before the content is displayed on the screen, i.e. the following is exagerated, just to explain the issue:

If I click on a button which executes something ajaxy, the loading div appears 5 seconds after clicking the button. The div stays on the screen for 10 seconds, the div disappears and the content change happens 5 seconds after the div has disappeared.

Any idea why this is happening and how I can get the message to display itself as soon as any click event happens, and only disappear when the html has finished loading on the screen?

  • 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-12T00:29:12+00:00Added an answer on June 12, 2026 at 12:29 am

    This happens because this function executes during the actual ajax call not before and after your click handler and callback which hapen at either end of the ajax call.

    If you look at your code, you’re probably doing something to prep for the ajax call in the click event of the button BEFORE the ajax call, then in the callback the ajax call is complete, so the message is hidden, but you still have code to complete.

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

Sidebar

Related Questions

I have the following scripts which work fairly nicely: $(#spanLoading).ajaxStart(function () { $('#spanLoading').empty().append(<img src='/img/loading.gif'
I have the following script which works fairly well: $(.btnMinimize).live('click', function(event) { event.preventDefault(); $(
I have the following script which works fine: $.ajax({ url: 'serverside_script', type: 'GET', dataType:
I have the following script which works kind of... $(document).ready(function(){ // add or remove
I have the following code which works great:- $('.ajax a').click(function() { getpageajax(this.href); return false;
I have the following script which works well: $(that).parents(.portlet).fadeOut('slow', function() { $(that).parents(.portlet).remove(); }); It
I have the following function in a PHP script, which returns and API call:
I have the following lua script : module(modoo,package.seeall) foo=1 bar={12,34} Which works fine using
I have the following Ruby script that creates a Debian package, which works fine:
I have the following recursive function which works... up until a point. Then 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.