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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:16:51+00:00 2026-06-03T01:16:51+00:00

I have an ajax call for some data (using jQuery). after the user clicks

  • 0

I have an ajax call for some data (using jQuery). after the user clicks “submit” (and the ajax call has been sent) I am displaying a “Please wait…” message that disables everything until the request returns (so the user won’t double click or click other things and mess things up).

It works great when there is any kind of error – the “Please wait…” disappears and I am displaying the user what went wrong.

But what happens if the server don’t return me anything back because of communication error?

The solution I found for that is to set a timeout of 10 seconds for the “Please wait..” message that after that time it disappears and displays and error that “The communication failed”. I assume that if the server didn’t respond after 10 seconds then it will not respond at all – but that it false assumption.

The problem is – how can I be sure that after 20 seconds the server won’t return something back? The scenario that might happen is that the user click submits –> 10 seconds later he get an error message –> 5 seconds later server response and confuses the user

How do I make sure that after I hide the “Please wait..” message nothing will pop up from the server?

  • 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-03T01:16:53+00:00Added an answer on June 3, 2026 at 1:16 am

    when you send a request to a server. a connection is opened and its kept open unless the server responds.
    1.if due to some error on the server side it cannot respond then a response code of 5xx is sent back generally (503)
    2.if due to some connection issues the connection is terminated prematurely then also jquery would take that as an error.

    1.so if you wanna wait for the server to send a request or connection termination (which ever occurs earlier) then u can use the completed option in the jquery ajax.
    2.and if you are in a condition in which server isnt responding even after 20 secs and you think that it should have responded by now use timeout.
    3.finally if your problem is that you are using some kind of customized(hand made http server) which doesn’t end a request even if it encounters some error then atleast customize it enough so that it sends back some response code(because this is HTTP model of request and response)

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

Sidebar

Related Questions

Im using jquery to call a page via ajax. I have some jquery functions
I'm using jQuery to implement some ajax features. For example: when a user clicks
I have a website where an ajax call will get some Json data from
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
Quick question: I'm using jquery ajax to call a page that returns some json
I'm using asp mvc 2 and I have a page which has some data
I am using the JQuery .post method to get data using an AJAX call.
If I have an ajax call off fetching (with a callback) and then some
i have an ajax call $.ajax({ url: '<%=Url.Action(SaveDetails,Survey) %>', dataType: 'JSON', cache: false, data:
I have an ajax call. I put the return value (data) in a variable

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.