From 56651a94c4e6b5d6e56774927fc016843f20a635 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 23 Nov 2020 10:52:33 +0300 Subject: [PATCH] Slightly more correct --- programs/server/play.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/server/play.html b/programs/server/play.html index d78a60ff83b..6fcf5e76c11 100644 --- a/programs/server/play.html +++ b/programs/server/play.html @@ -332,10 +332,6 @@ var xhr = new XMLHttpRequest; xhr.open('POST', url, true); - xhr.send(query); - - document.getElementById('check-mark').style.display = 'none'; - document.getElementById('hourglass').style.display = 'inline'; xhr.onreadystatechange = function() { @@ -363,6 +359,11 @@ //console.log(this); } } + + document.getElementById('check-mark').style.display = 'none'; + document.getElementById('hourglass').style.display = 'inline'; + + xhr.send(query); } function renderResponse(status, response) { @@ -507,7 +508,7 @@ function renderError(response) { clear(); - document.getElementById('error').innerText = response; + document.getElementById('error').innerText = response ? response : "No response."; document.getElementById('error').style.display = 'block'; }