3 ms·
I think about this when I am using XMLHttpRequest in a web worker, and can't actually get an XML document back because you don't have access to an xml parser be
by Torgo 10y ago
I think about this when I am using XMLHttpRequest in a web worker, and can't actually get an XML document back because you don't have access to an xml parser because there's no dom in web workers.
- andrewmcwatters 10y agoWhy would you use XMLHttpRequest in a web worker? Why would you not just delegate working with the result to a web worker? The requests shouldn't dispatch any faster.
- Torgo 10y agoonly point here is it was it was explicitly created for getting back an xml document (by microsoft, outside of any standards body, no less) while 99% of the time it's returning text or json, and in a web worker this XML tool literally can't return an XML document at all.
- gsnedders 10y agoIt can also fetch content over FTP in most browsers, in which case it isn't necessarily an HTTP tool either.
- EdSharkey 10y agoWhat you're saying is technically true, but only because the XML classes are historically also (unfortunately) DOM classes. It's too bad that XML DOM can't be made into Transferrables (losing their DOM'iness) in modern browsers and thus usable in Web Workers. I suppose XML isn't that widely used in the browser, so that would never happen. Read the history of XHR and you'll get a fascinating look at how clever teams can slip real innovation into products just by tickling the right business folks' ears. http://www.alexhopmann.com/story-of-xmlhttp/ http://www.alexhopmann.com/story-of-xmlhttp/ > Which is the real explanation of where the name XMLHTTP comes from- the thing is mostly about HTTP and doesn’t have any specific tie to XML other than that was the easiest excuse for shipping it so I needed to cram XML into the name (plus- XML was the hot technology at the time and it seemed like some good marketing for the component).