Skip to content

Commit

Permalink
Use XMLHttpRequest.responseType
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed May 9, 2019
1 parent 6402cdf commit 9b80172
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ export function getJSON(url, params, callback) {
callback('');
return;
}
callback(JSON.parse(xmlHttp.response));
callback(xmlHttp.response);
};
xmlHttp.open('GET', url + getParamString(params), true);
xmlHttp.responseType = 'json';
xmlHttp.setRequestHeader('Accept', 'application/json');
xmlHttp.send(null);
}
Expand Down

0 comments on commit 9b80172

Please sign in to comment.