From da577ecde67e6f02fef32ca58ad55fc2211e473c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Sun, 15 Jan 2023 11:18:52 +0100 Subject: [PATCH] =?UTF-8?q?3=20=C3=A8me=20essaie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/src/JS/dashboard.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/View/src/JS/dashboard.js b/View/src/JS/dashboard.js index ff7e6d3c..baa3219d 100644 --- a/View/src/JS/dashboard.js +++ b/View/src/JS/dashboard.js @@ -3,20 +3,8 @@ window.onload = function () { xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true); xhr.responseType = 'text'; xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.onload = function () { - var players = JSON.parse(xhr.responseText); - // if (players[0] != null) { - // var player1 = players[0]; - // } - // if (players[1] != null) { - // var player2 = players[1]; - // } - // if (players[2] != null) { - // var player3 = players[2]; - // } - // if (players[3] != null) { - // var player4 = players[3]; - // } + var players = xhr.onload = function () { + return JSON.parse(xhr.responseText); }; xhr.send(null); data = [];