May 08, 2021 AJAX
xhr.status
code, e.g. 200,304,404, etc.;
xhr.responseText
and
xhr.responseXML
the response body.
For a response from the server, use the responseText or
responseText
properties of the XMLHttpRequest object.
responseXML
Property | Describe |
---|---|
responseText | Gets the response data in the form of a string. |
responseXML | Get response data in XML form. |
If the response from the server is not XML, use the
responseText
responseText
returns a response in the form of a string, so you can use this:
Tip: For
responseText
the responseText property is available only if the
readyState
responseText
to 4 because it indicates that the AJAX request is over!
If the response from the server is XML and needs to be resolved as an XML object, use the
responseXML
Request cd_catalog.xml file and resolve the response: