responseText
Summary
Returns the text response entity body, a string representing the response entity body, which is the fragment of the entity body of the response received so far (if LOADING) or the complete entity body of the response (if DONE).
Property of apis/xhr/XMLHttpRequestapis/xhr/XMLHttpRequest
Syntax
Note: This property is read-only.
var result = element.responseText;
Return Value
Returns an object of type StringString
Examples
// receive data sent from the server
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
var responseText = xhr.responseText;
}
}
Related specifications
- W3C XMLHttpRequest Specification
- W3C Working Draft
Attributions
Microsoft Developer Network: Windows Internet Explorer API reference Article