XmlHttpRequest.responseText while loading (readyState==3) in Chrome

Chrome has a bug where it will only populate xhr.responseText after a certain number of bytes has been received. There are 2 ways to get around this,

Set the content type of the return to “application/octet-stream”

or

Send a prelude of about 2kb to prep the handler.

Either of these methods should make chrome populate the responseText field when readyState == 3.

IE7/8 on the other hand can’t do it, you need to resort to long polling or use the cross domain trick with XDomainRequest in IE8, a la MS

Leave a Comment