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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:27:32+00:00 2026-06-09T22:27:32+00:00

I have used a simple AJAX call in a webpage. he webpage is like

  • 0

I have used a simple AJAX call in a webpage.
he webpage is like this. On clicking the submit button the JavaScript sends the data in a text box to server and displays the response in a div.

My AJAX code is:

var xmlHttp = null;
var api="getdetails.jsp?id=";
var theUrl=api.concat(theId);
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send();
document.getElementById("details").innerHTML=xmlHttp.responseText;

But the problem is that while waiting for the AJAX response the webpage becomes inactive. That is, the user cannot type in text box or click any other link or so. Nothing can be done till the response is received.

How can I make the webpage to be functional while waiting for the response? Do I have to employ multi-threading or any other way?

  • 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-09T22:27:34+00:00Added an answer on June 9, 2026 at 10:27 pm

    You need to make your ajax request asynchronous, by setting the

    xmlhttp.open("GET",theUrl,true);

    third parameter in your request as true.

    Also this line

    document.getElementById("details").innerHTML=xmlHttp.responseText;

    Should be written with

    xmlHttp.onreadystatechange

    so that when a state change happens and the result is available in responseText then only u can set a dom element. Please read the documentation of using ajax carefully.

    See this example http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first

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

Sidebar

Related Questions

I have a simple ajax call like this: $.ajax({ url: u, type: POST, dataType:
I used to have this kind of simple JSON data and I could successfully
I used to have a simple ajax that helped me take all items from
I have a simple challenge with a background not animating. I have used this
I am trying to implement a simple subscribe button using Paypal. I have used
I have a simple form which updates values in the db via ajax call
I have something like the StackOverflow's "Ask Question" page, where a text-box is used
This javascript I have is supposed to be very simple. It is, but IE
I have a basic form that I would like to submit using ajax, without
I have used following code to create a simple PDF file. It executes fine

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.