From e2563ea5a83b1af11fd082b81f68dcc7ee8f489f Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Mon, 18 Mar 2019 23:37:55 +1100 Subject: [PATCH] Swapped http refresh to ajax --- .gitignore | 1 + static/js/custom.js | 13 +++++++++++++ templates/index.html | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 static/js/custom.js diff --git a/.gitignore b/.gitignore index ef98138..0436f6c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .tcreds venv/ test* +.vscode/ \ No newline at end of file diff --git a/static/js/custom.js b/static/js/custom.js new file mode 100644 index 0000000..8eba158 --- /dev/null +++ b/static/js/custom.js @@ -0,0 +1,13 @@ +var domain = "test.benjamyn-testing.com" +function loadContent() { + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + document.body.innerHTML = this.responseText + } + }; + xhttp.open("GET", domain, true); + xhttp.send(); +} + +setInterval(loadContent, 60000) \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index f681f1d..bca1cef 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,7 +8,6 @@ - - + \ +