How to handle multiple or concurrent requests in Ajax?
For multiple or concurrent requests, create a separate XmlHttpRequest objects for each request.
For example,
If you want to create a request to get data from an SQL tableA, Use the below mention code …
xmlHttpObject1.Onreadystatechange = functionfromTableA();
and to get data from another table (say tableB) at the same time, use
xmlHttpObject2.Onreadystatechange = functionfromTableB();
You have to open the XmlHttpObject & parameters passed too, like as mentioned below
xmlHTTPObject1.open("GET","http://"localhost// " + "Website1/Default1.aspx" true);
The parameter “true” used in the last in the above mentioned code. This means the process will carry on without waiting for the response from the webserver. If it is “false” It will wait for the response from the web server.