-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch1.htm
32 lines (30 loc) · 1.07 KB
/
ch1.htm
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
<html>
<head>
<script>
list = '<table><tr><th>Start</th><th>End</th><th>Approved</th></tr></table>';
replies = '';
function search()
{
var holidaysDIV = document.getElementById('holidays');
var empidTXT = document.getElementById('empid');
var xhttp = new XMLHttpRequest();
xhttp.withCredentials = true;
xhttp.onreadystatechange = function(x) {
if (this.readyState == 4 && this.status == 200)
document.getElementById("holidays").innerHTML = this.responseText;
};
xhttp.open("GET", "http://localhost:8088/payroll/holiday/empid=" + empidTXT.value)
xhttp.setRequestHeader("Accept", "text/html");
xhttp.send();
holidaysDIV.innerHTML = list;
}
</script>
</head>
<body>
<p>Employee number: <input id="empid" type="text" />
<input type="button" value="Search" onclick="search()"></p>
<p>Holiday list</p>
<div id="holidays">
</div>
</body>
</html>