stopped coding JS in C

This commit is contained in:
d3m1g0d
2019-04-16 17:12:43 +02:00
parent c8b3ab2413
commit 45594aeac0
+3 -3
View File
@@ -1,17 +1,17 @@
var globalObject; var globalObject;
$('#update').click(function () { $('#update').click(function () {
updateData(globalObject); globalObject = updateData();
fillTable(globalObject, $('table')); fillTable(globalObject, $('table'));
graphSpectralData(globalObject, $('#spectrogram')); graphSpectralData(globalObject, $('#spectrogram'));
}); });
// jQuery event binder // jQuery event binder
function updateData (obj) { function updateData () {
// download data from backend into obj // download data from backend into obj
const url = 'http://' + window.location.hostname + ':5000/data'; const url = 'http://' + window.location.hostname + ':5000/data';
// I understand how bad this line looks. Please don't judge me... // I understand how bad this line looks. Please don't judge me...
$.get(url, function (data, status) { // standard jQuery AJAX $.get(url, function (data, status) { // standard jQuery AJAX
obj = data; return data;
}); });
} }