forked from NeilVdB/ThomasMoreCiscoLighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wip.html
59 lines (52 loc) · 1.49 KB
/
wip.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Work in Progress</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body class="wip-bg">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var run = true;
function readcontrollers(){
if (!run){
return;
}
var input = getRemote("/cgi-bin/test.py");
input = input.replace(/'/g, '"');
input = input.replace(/True/g, 1);
input = input.replace(/False/g, 2);
console.log(input.trim());
var obj = JSON.parse(input.trim());
if (obj[0].red == 1){
navigatie("explore.html");
}
}
function getRemote(remote_url) {
return $.ajax({
type: "GET",
url: remote_url,
async: false
}).responseText;
}
function navigatie(url) {
run = false;
window.location.href = url;
}
$(document).ready(function() {
setTimeout(function () {
setInterval(function(){ readcontrollers(); }, 500);
})
}, 2000);
</script>
</body>
<a href="explore.html">
<div class="terug">
Back
</div>
</a>
</html>