fixed race condition in updateData

This commit is contained in:
Kristjan Komlosi
2019-11-01 20:03:56 +01:00
parent ca88cd7d71
commit 759fc6affe

View File

@@ -9,11 +9,9 @@ function updateData () {
const url = 'http://' + window.location.hostname + ':5000/data'; const url = 'http://' + window.location.hostname + ':5000/data';
$.ajax({ // spawn an AJAX request $.ajax({ // spawn an AJAX request
url: url, url: url,
success: function (data, status) { globalObject = data; }, success: function (data, status) { globalObject = data; console.log(data); },
timeout: 2500 // this should be a pretty sane timeout timeout: 2500 // this should be a pretty sane timeout
}).done( })
console.log(globalObject)
); // INSERT THE DATA HANDLER HERE!!!
} }
function fillTable (obj, dom) { function fillTable (obj, dom) {