From 45594aeac04011042df76098925a007b30e94b8c Mon Sep 17 00:00:00 2001 From: d3m1g0d Date: Tue, 16 Apr 2019 17:12:43 +0200 Subject: [PATCH] stopped coding JS in C --- frontend/frontend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/frontend.js b/frontend/frontend.js index 0104c39..6413b10 100644 --- a/frontend/frontend.js +++ b/frontend/frontend.js @@ -1,17 +1,17 @@ var globalObject; $('#update').click(function () { - updateData(globalObject); + globalObject = updateData(); fillTable(globalObject, $('table')); graphSpectralData(globalObject, $('#spectrogram')); }); // jQuery event binder -function updateData (obj) { +function updateData () { // download data from backend into obj const url = 'http://' + window.location.hostname + ':5000/data'; // I understand how bad this line looks. Please don't judge me... $.get(url, function (data, status) { // standard jQuery AJAX - obj = data; + return data; }); }