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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:34:33+00:00 2026-05-26T20:34:33+00:00

il give an example document.ready(function() { $(#Show).bind(click, function() { var F = Function2(); if

  • 0

il give an example

document.ready(function() {
    $("#Show").bind("click", function() 
    {
        var F = Function2();
        if (F)
        {
            // Do Other Stuff.
        }
    }
});

function Function2()
{
    $("#Message").Show();

    $.ajax({
              type: "POST",
               url: [MyURL]
               async: false;
               contentType: 'application/json; charset=utf-8',
               data: JSON.stringify(PostData),
               dataType: "json",
               success: function (returnVal) {
           $("#Message").Hide();
                   return true;
               },
               error: function (xhr, ajaxOptions, thrownError) {
                   return false;
               }
           });

}

</script>




<div id="Message" style="display:none;">
    <!-- Loading Image In here -->
</div>
<a href="#" id="Show" onclick="return:false;">Show then Hide</false>
</code>

Now what I want to happen is for this messagebox to show however the AJAX for some reason wont show it until the AJAX Request is finished by which point it is too late. I have set async to false which hasent helped either.

  • 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-26T20:34:34+00:00Added an answer on May 26, 2026 at 8:34 pm

    I think the root of this issue is a syntax error. JavaScript is case sensitive, so the correct syntax would be lowercase show() and hide()

    If you’re still having an issue after fixing the syntax errors, try using the ajaxStart event to show the message and hide it on success.

    //use the ajaxstart event to display the message
    $('#message').ajaxStart(function() {
        $(this).show("slow");
    });
    
    $.ajax({   
        type: "POST",   
        url: [MyURL]   
        async: false;   
        contentType: 'application/json; charset=utf-8',   
        data: JSON.stringify(PostData),   
        dataType: "json",   
        success: function (returnVal) {   
            $("#Message").hide("slow"); //hide message on success   
            return true;   
        },   
        error: function (xhr, ajaxOptions, thrownError) {   
            return false;   
        }   
    });  
    

    Delaying the show or hide

    $("#message").delay(3000).hide("slow");
    

    Here’s a jsFiddle: http://jsfiddle.net/rs83R/

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

Sidebar

Related Questions

This is jQuery UI code example: <script type=text/javascript> //function to execute when doc ready
$(document).ready(function(){ $(form#fbox).submit(function(){ var msg = $(input#ibox).val(); $.get(foo.php, {m: msg}, function(data){ $('#display').html(data); }); return false;
We are using following fields to do some calculation. $(document).ready(function(){ $('.num').blur(function () { var
I know how to do this... I'll give example code below. But I can't
To give an example of the kind of request that I can't figure out
Can someone give an example of a good time to actually use unsafe and
Can you give an example where the Queue data structure can be specially helpful
Can someone give an example for finding greatest common divisor algorithm for more than
Could you give an example where static_assert(...) ('C++11') would solve the problem in hand
Can you give an example of stack overflow in C++?

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.