mochi / mochikit

MochiKit makes JavaScript suck less

Home Page:http://mochi.github.io/mochikit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async: Check on responseText always fails if a local resource is requested and XHR's responseType is set

ptz opened this issue · comments

In recent versions of Chrome and Firefox the following code always calls errback if 'whatever' is a local resource

var xhr = getXMLHttpRequest();
xhr.open('GET', 'whatever');
xhr.responseType = 'arraybuffer';
sendXMLHttpRequest(xhr);

Here we need xhr.response, not xhr.responseText or xhr.responseXML, but MochiKit.Async._xhr_onreadystatechange fails if status is 0 and responseText is not set.

Could you hack up a patch for this and add a pull request?

Thanks for the patch! Now merged and repacked.