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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:48:56+00:00 2026-05-25T06:48:56+00:00

How to show waiting message on sync ajax call in browser ? I tried

  • 0

How to show waiting message on sync ajax call in browser ?
I tried code below, turned web server off but “Saving” message is not displayed.

After some time only error event from ajax call occurs, without any progress message.

How to show waiting message to user if sync ajax call is in progress ?

var myInfo = '<div class="ui-state-highlight ui-corner-all" style="position: fixed;' +
    'z-index: 10000; margin-top: 2%; margin-left: 2%">' +
    ' <br />' +
    '&nbsp;<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>' +
    '<strong>Saving</strong>&nbsp;<br />' +
    '<br /></div>'
$('#_info').html(myInfo);
$('#_info').show();

$.ajax( 'save',
   {
       async: false,
       type: 'POST'
    } );
  • 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-25T06:48:56+00:00Added an answer on May 25, 2026 at 6:48 am

    Your problem is that you’re using a synchronous AJAX call and that pretty much locks up the browser until it completes. In particular, the browser won’t be able to show your “loading” message before you hit the $.ajax({async:false}) lockup; for example, watch what this does:

    http://jsfiddle.net/ambiguous/xAdk5/

    Notice that the button doesn’t even change back to the unclicked visual state while the AJAX is running?

    The solution is to show your loading message, hand control back to the browser, and then lock everything up with your synchronous remote call. One way to do this is to use setTimeout with a delay of zero:

    $('#_info').html(myInfo);
    $('#_info').show();
    setTimeout(function() {
        $.ajax('save', {
            async: false,
            type: 'POST',
            complete: function() {
              $('#_info').hide();
            }
        });
    }, 0);
    

    For example: http://jsfiddle.net/ambiguous/zLnED/

    Some care will be needed of course as this won’t be the same inside the setTimeout callback as it was outside but that’s easy to take care of.

    Using async:false isn’t a very nice thing to be doing to your users though, you should try to avoid it unless it is absolutely necessary (and it rarely is).

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

Sidebar

Related Questions

ajaxSubmit.js: $(document).ready(function(){ $('#submit').click(function() { $('#waiting').show(500); $('#reg').hide(0); $('#message').hide(0); $.ajax({ type : 'POST', url : 'post.php',
When i use one jpeg image with this web-server its very slow to show
When I use Ajax call(jquery) in the HEAD section I find a waiting for
I see the benefit of asynchronous commands (waiting for server responses...) but in my
when user changes password I want to show message Successfully changed! and when user
After complete of asynchronous call to WCF service I want set success message into
I would like to make an Ajax request to the server, which replies a
Firstly I tried fiding some similar posts but could not quite find anything. Mainly
Please check the following sample code. Toast messages are shown but the progressdialog is
Is there any easy and clean way to show a message box in Qt4

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.