Swapped http refresh to ajax

This commit is contained in:
Benjamyn Love 2019-03-18 23:37:55 +11:00
parent 92b71b8d87
commit e2563ea5a8
3 changed files with 16 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.tcreds
venv/
test*
.vscode/

13
static/js/custom.js Normal file
View File

@ -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)

View File

@ -8,7 +8,6 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://benjamyn.love/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/custom.css">
<meta http-equiv="refresh" content="60">
</head>
<body style="background:#4D4759">
<div class="navbar h-100 d-flex justify-content-center pcol" style="margin-bottom: 10px; ">
@ -32,7 +31,8 @@
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->\
<script src="static/js/custom.js"></script>
<script src="https://benjamyn.love/js/jquery-3.3.1.slim.min.js"></script>
<script src="https://benjamyn.love/js/popper.min.js"></script>
<script src="https://benjamyn.love/js/bootstrap.min.js"></script>