This topic has not yet been rated - Rate this topic

responseText Property

Contains the body of the response returned by the server.

Syntax

[ p = ] object.responseText

Possible Values

p String that receives the text received from the server.

The property is read-only. The property has no default value.

Remarks

After the onload event has been raised, responseText contains the complete server response.

In the time after the onprogress event is raised and before the onload event is raised, responseText contains either a partial response or the complete server response.

The responseText value is an empty (zero-length) string in three cases:

  1. before the onprogress event is raised
  2. after the onprogress event is raised and before the first character has been received
  3. after the onload event is raised and the server has returned an empty string as a response

Example

For an example of how this property is used, see Introducing Cross-domain Request.

Standards Information

There is no public standard that applies to this property.

Applies To

XDomainRequest, XDomainRequest Constructor

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
how can I delete this comment?
how can I delete this comment?
The performance for responseText.length is horrible
in my onprogress handler I am reading the responseText.length and I found out after profiling it with IE9 debug tools that it horrible when it comes to performance $0it takes 95% of total time spent in onprogress handler while in the same function I am doing math calculations, canvas drawings, and other stuff.$0 $0this is unacceptable$0 $0I am probably guessing why is so slow, because instead of reading the content-length header it's actually reading the content, building an internal string and then callign length on that string... or maybe a different reason$0 $0anyhow, been so slow it screws up the entire onprogress handler because probably the handler is too slow while other onprogress events are fired and the whole internal message handling gets messed up.$0 $0please provide and workaround or fix this as soon as possible.$0 $0thanks!$0 $0Ova$0