-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataTable.htm
55 lines (45 loc) · 1.33 KB
/
DataTable.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>RFID Hour Log</title>
</head>
<body>
<center>
<div id = "DataTable">DataTable goes here</div>
<button onclick = "createDataTable()">Show Table</button>
<script language="JavaScript" type="text/javascript">
<!--
function createDataTable()
{
var txt = "<table>";
var tag = getData("tag", 0);
var sName = getData("name", 0);
var time = getData("time", 0);
for (count = 1; tag && sName && time; ++count)
{
txt += "<tr><td>"+ tag + "</td><td>" + sName + "</td><td>" + time + "</td></tr>";
tag = getData("tag", count);
sName = getData("name", count);
time = getData("time", count);
}
document.getElementById("DataTable").innerHTML = txt;
}
function getData(dataName, rowNumber)
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","192.168.0.20/" + dataName,false);
xmlhttp.send();
return xmlhttp.responseXML.getElementsByTagName("data")[count].childNodes[0].nodeValue;
}
//-->
</script>
</body>
</html>