-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (35 loc) · 1.17 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<title>Absen</title>
</head>
<body>
<br>
<div class="container">
<div class="row">
<div class="col text-center">
<button type="submit" onclick="javascript:callREST()" class="btn btn-primary">Buka Kamera </button>
<div id="response"></div>
</div>
</div>
</div>
<script>
function callREST() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
let data = JSON.parse(this.responseText)
document.getElementById("response").innerHTML = 'Nama = ' + data.data
}
};
xhttp.open("GET", "http://localhost:4000/bukakamera", true);
xhttp.send();
}
</script>
</body>
</html>