Skip to content

Commit 4a2b4c6

Browse files
committed
Merge branch 'master' into dev
2 parents 99d0f6a + 10f74d0 commit 4a2b4c6

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎lib/defaultHttpRequest.js‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ function DefaultHttpRequest() {
4545
xhr.onload = function () {
4646
try {
4747
if (xhr.status === 200) {
48-
var response = xhr.response;
49-
if (typeof response === "string") {
50-
response = JSON.parse(response);
48+
var response = "";
49+
// To support IE9 get the response from xhr.responseText not xhr.response
50+
if (window.XDomainRequest) {
51+
response = xhr.responseText;
52+
} else {
53+
response = xhr.response;
54+
}
55+
if (typeof response === "string") {
56+
response = JSON.parse(response);
57+
}
58+
resolve(response);
5159
}
52-
resolve(response);
53-
}
5460
else {
5561
reject(Error(xhr.statusText + "(" + xhr.status + ")"));
5662
}

0 commit comments

Comments
 (0)