Closed jonahsimpson closed 10 years ago
Thanks for the report Jonah, it's interesting, I've had a PR to make writeBody
to change it to the way it is now... I have a feeling there's a browser difference somewhere here. Which browsers and versions is this happening on?
IE 8 and 9. Note - this only occurs with the legacy code that is expecting a responseXML property when making a request for XML content (it's setting the headers and everything properly). The same call, executed with jQuery instead of custom XHR code, returns data as expected.
Do you remember what issue the original PR was solving?
Hey @jonahsimpson your fix is in, it actually went it a little while ago I just forgot to comment!
Hi!
We are using xdomain.js with some legacy code that manually calls xhr and have noticed a bug.
The xhr call is getting some xml content and reading the result out of response.responseXML. When we execute without xdomain.js the data is in response.responseXML as expected. However, if we include xdomain.js and make the same call, response.responseXML returns null.
We've tracked this problem down to the writeBody() function:
As far as I can tell, response.text will always exist when response.xml exists. If we modify the writeBody method to look something like the following, the problem goes away.
Can you confirm that this is a legit fix? Sorry, I woulda have done a pull request, but I don't know coffeescript.
Thanks in advance!