From ce96e15911be99aff46767cc80bbc56c9cab297b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 18 Jun 2020 16:20:45 +0200 Subject: [PATCH] MAPG-148 set xhr responseType after xhr open() because it is accepted by all browsers --- public/static/js/mapguesser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/static/js/mapguesser.js b/public/static/js/mapguesser.js index 1b9c2f7..cc7198f 100644 --- a/public/static/js/mapguesser.js +++ b/public/static/js/mapguesser.js @@ -2,11 +2,12 @@ var MapGuesser = { httpRequest: function (method, url, callback, data) { var xhr = new XMLHttpRequest(); - xhr.responseType = 'json'; xhr.onload = callback; xhr.open(method, url, true); + xhr.responseType = 'json'; + if (method === 'POST') { if (typeof data === 'undefined') { data = new FormData();