|
INTERVIEW QUESTIONS
WEB
WEB CAREERS
DETAILS
Question: How to handle multiple or concurrent requests in Ajax?
Answer: For concurrent requests, declare separate XmlHttpRequest objects for each request. For example, for request to get data from an SQL table1, use something like this... xmlHttpObject1.Onreadystatechange = functionfromTable1(); and to get data from another table (say table2) at the same time, use xmlHttpObject2.Onreadystatechange = functionfromTable2(); Ofcourse, the XmlHttpObject needs to be opened & parameters passed too, like as shown below... xmlHTTPObject1.open("GET","http://"localhost// " + "Website1/Default1.aspx" true); Note that the last parameter "true" used above means that processing shall carry on without waiting for any response from the web server. If it is false, the function shall wait for a response.
|
|
|
Category |
Web Careers Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7107 users |
Added on |
8/6/2015 |
Views |
69980 |
Rate it! |
|
|
Question:
How to handle multiple or concurrent requests in Ajax?
Answer:
For concurrent requests, declare separate XmlHttpRequest objects for each request. For example, for request to get data from an SQL table1, use something like this... xmlHttpObject1.Onreadystatechange = functionfromTable1(); and to get data from another table (say table2) at the same time, use xmlHttpObject2.Onreadystatechange = functionfromTable2(); Ofcourse, the XmlHttpObject needs to be opened & parameters passed too, like as shown below... xmlHTTPObject1.open("GET","http://"localhost// " + "Website1/Default1.aspx" true); Note that the last parameter "true" used above means that processing shall carry on without waiting for any response from the web server. If it is false, the function shall wait for a response. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Web Careers Interview Questions & Answers - Exam Mode /
Learning Mode
|