AJAX Interview Questions and Answers

AJAX stands for Asynchronous JavaScript And XML.It is not a programming language.It allows web pages to be updated asynchronously by exchanging data with a web server.This means that it is possible to update parts of a web page without reloading the whole page.


11) What are the important methods of XMLHttpRequest?

  1. abort() - It is used to cancel the current request.
  2. getAllResponseHeaders() - It returns the header details.
  3. getResponseHeader() - It returns the specific header details.
  4. open() - It is used to open the request.
  5. send() - It is used to send the request.
  6. setRequestHeader() - It adds request header.


12) What are different ready state in ajax?

There are total 5 ready state in Ajax:

Value State Description
0 UNSET Client has been created. Open() not yet called.
1 OPENED Open() called.
2 HEADRERS_RECIEVED Send() called and headers are available.
3 LOADING Downloading: responseText holds partial data.
4 DONE The operation is complete.


13) What is polling in AJAX?

The Process of retrieving data from a server to obtain near-live data regularly is called AJAX polling.