Skip to content

Commit

Permalink
Use xhr.onreadystatechange for basic ie8 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrowe committed Mar 5, 2015
1 parent 2f2ed4c commit 9d2b99b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@
return;
}

xhr.onload = function() {
xhr.onreadystatechange = xhr.onload = function() {
if (xhr.readyState !== 4) {
return
}
var status = (xhr.status === 1223) ? 204 : xhr.status
if (status < 100 || status > 599) {
reject(new TypeError('Network request failed'))
Expand Down

0 comments on commit 9d2b99b

Please sign in to comment.