Merged in bugfix/MAPG-148-fix-xmlhttp-responsetype-error (pull request #118)

MAPG-148 set xhr responseType after xhr open() because it is accepted by all browsers
This commit is contained in:
Bence Pőcze 2020-06-18 14:21:30 +00:00
commit 43775c8f4f

View File

@ -2,11 +2,12 @@ var MapGuesser = {
httpRequest: function (method, url, callback, data) { httpRequest: function (method, url, callback, data) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.onload = callback; xhr.onload = callback;
xhr.open(method, url, true); xhr.open(method, url, true);
xhr.responseType = 'json';
if (method === 'POST') { if (method === 'POST') {
if (typeof data === 'undefined') { if (typeof data === 'undefined') {
data = new FormData(); data = new FormData();