What are the properties of XMLHttpRequest?

What are the properties of XMLHttpRequest?

XMLHttpRequest is used to transfer data between a web browser and server. Here are its properties:

  • Onreadystatechange: This property calls a function on every state change.
  • ready state: This property holds the status of XMLHttpRequest.

0: The request is not initialized 
1: The server connection has been established
2: The request has been received 
3: The request is in process
4: The request is completed

  • responseText: It returns the response as a string.
  • response XML: It returns the response as a XML document. This should be used if you need to return multiple values from your AJAX request.
  • Status: Returns the status-number of the request from server such as 200 for “OK” or 404 for “Not Found”.
  • status Text: Returns the status as text instead of number such as “OK” or “Not Found”.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.