From f822befed9f4b39f76993adb2376d694023868bf Mon Sep 17 00:00:00 2001 From: maride Date: Fri, 11 Oct 2019 14:53:34 +0200 Subject: Display current team score on the website --- hosted/stats.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 hosted/stats.js (limited to 'hosted/stats.js') diff --git a/hosted/stats.js b/hosted/stats.js new file mode 100644 index 0000000..f82368f --- /dev/null +++ b/hosted/stats.js @@ -0,0 +1,12 @@ +function loadStatsAndRender() { + $.get("/api/getStats").done(function(data) { + var result = jQuery.parseJSON(data); + $("#_teamScore").text(result["score"]); + // Re-run in 10s + setTimeout(function(){loadStatsAndRender();}, 10000); + }); +} + +$(document).ready(function() { + loadStatsAndRender(); +}); \ No newline at end of file -- cgit 1.4.1