Ajax has made it easier to send and retrieve data from a server asynchronously without interfering with the existing page’s display and functionality.
Ajax response is the server response, and
Ajax.Response is the object passed as the first argument of all Ajax requests callbacks.
The server sends the HTTP status code.
statusText Type: String.
Status text sent by sever.
readyState Type: Number. The current state of the request.
The numbers are on the left side and state on the right side.
responseText Type: String. Response sent refers to the text body.
responseXML Type: document Object. Response of body that comprises of XML. This only works if the request is set to XML.
responseJSON Type: Object, Array. Response of body that comprises of JSON. This only works if the request is set to JSON.
headerJSON Type: Object, Array.
X-JSON (if present) sends auto-evaluated content. It is used to transfer little pieces of data.
request Type: Object. The request object.
transport Type: Object. Refers to the
xmlHttpRequest object itself.
getHeader(name) Type: String. This method returns the value of present header (if requested); otherwise, null.
getAllHeaders() Type: String. This method returns a string. This contains all headers as a string.
getResponseHeader(name) Type: String. This method returns the value of the present header (if requested and if present); otherwise, it throws an error.
getAllResponseHeaders() Type: String. This method returns a string and contains all headers as a string; otherwise, it throws an error otherwise.
View all Courses