Wrong result status of XMLHttpRequest

Wrong result status of XMLHttpRequest

Hello, in a HTML5 app I'm doing a XMLHttpRequest like this: var req = new XMLHttpRequest(); req.open("GET", "data/text.json", FALSE); req.send(null); if (req.status !== 200) // display error else // proceed This works perfectly in all normal browsers. But in the encapsulated app running on Windows I always get the error message displayed and while debugging with the "inspect" functionality I found the core of the problem: the result code is "0" when the request was successful. As the script expects "200" as HTTP result code for "OK", it thinks there was an error although everything worked fine. Now the question is why an code "0" is returned here instead of the correct "200". Of course, a work-around is easy (just accepting also a "0" as result code), but it does not make much sense that not "200" is returned here. Therefore I consider this as bug. ;-) Any ideas on that? Is this the right place to report such bugs? Best regards Andreas
3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Andreas,

I'll pass this by our engineers and get back with you.

Thanks
Jim

Hello Jim,

great, thank you!

Best regards
Andreas

Leave a Comment

Please sign in to add a comment. Not a member? Join today