-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (29 loc) · 858 Bytes
/
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
<!DOCTYPE html>
<html>
<body>
<div id="demo">
<h2>The XMLHttpRequest Object</h2>
<br>
<button type="button" onclick="loadDoc()">Send</button>
</div>
<br><br>
<div id="content">
</div>
<script>
document.getElementById("content").innerHTML = "Ready for sending";
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("content").innerHTML = this.responseText;
} else {
document.getElementById("content").innerHTML = "Error! (status: " + this.status + ")";
}
};
xhttp.open("POST", "/v2/reports/apartment", true);
document.getElementById("content").innerHTML = "Sending request...";
xhttp.send();
}
</script>
</body>
</html>