Skip to content
loading...

re: What To Expect When You're Expecting To Drop IE11 πŸ—‘οΈ VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Using XHR instead of the fetch API is not out of the question. Fetch isn't a 1:1 replacement, and as Chris Ferdinandi points out, requires two func...
 

You're not wrong, and the extra step is a bit misunderstood, although important if you want to stream large binary files (I used it in this PWA demo to show a %β€”blink and you'll miss it).

I have a few unrelated thoughts:

  • await makes the flow much nicer than Chris' examples
  • I'm also surprised neither link uses onload, instead using the more confusing onreadystatechange (and this is actually a vote for XHRs).
  • the lack of support for responseType = 'json' in IE11 actually makes XHRs more confusing, since you just can't safely use that parameter and you have to add a JSON.parse call too
code of conduct - report abuse