Room research

This commit is contained in:
Adrien Vannson
2021-10-14 22:09:36 +02:00
parent 7d16a1117f
commit a06faec64b
3 changed files with 49 additions and 34 deletions
+18 -2
View File
@@ -12,9 +12,25 @@ function httpGetAsync(theUrl, callback)
function researchRoom()
{
let text = document.getElementById('research').value;
var research = document.getElementById('research').value;
var xhr = new XMLHttpRequest();
xhr.open('GET', 'api/request.php?research='+encodeURI(research), true);
xhr.onload = function() {
var table = document.getElementById('research-results');
table.innerHTML = '';
document.getElementById('research-results-table').style.display = 'block';
res = JSON.parse(xhr.responseText);
for (var i=0; i<res.length; i++) {
table.innerHTML += '<tr><th scope="row">' + res[i].id + '</th><td>' + res[i].name + '</td></tr>';
}
};
xhr.send(null);
}
function putWaitNetworkScreen()