Skip to content

Commit db393e2

Browse files
committed
Switching responseType to 'json' breaks Chrome 16 nightly.
1 parent f60e1b1 commit db393e2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tzmap.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
if (!isHTTP || (200 <= gXHR.status && gXHR.status < 300)) {
7474
var json = null;
7575
try {
76-
if ("responseType" in gXHR) {
76+
if ("responseType" in gXHR && gXHR.responseType == "json") {
7777
json = gXHR.response;
7878
} else {
7979
json = JSON.parse(gXHR.responseText);
@@ -94,7 +94,12 @@
9494
gXHR.onreadystatechange = rsc;
9595
gXHR.open("GET", path);
9696
if ("responseType" in gXHR) {
97-
gXHR.responseType = "json";
97+
try {
98+
gXHR.responseType = "json";
99+
} catch(ex) {
100+
// Chrome 16 (nightly) supports "text" but not "json"
101+
gXHR.responseType = "text";
102+
}
98103
}
99104
gXHR.send();
100105
} catch(ex) {

0 commit comments

Comments
 (0)