-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.html
56 lines (51 loc) · 1.91 KB
/
info.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<meta charset="utf-8" />
<title>Form Submit Check</title>
<script type="text/javascript">
"use strict";
window.onload = function () {
function getHTTPObject() {
if (XMLHttpRequest) {
return new XMLHttpRequest();
} else if (ActiveXObject) {
try { return new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {
try { return new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) { }
}
} else { return false; }
}
var xmlRequest = getHTTPObject();
xmlRequest.open("GET", "formInfo.xml", false);
xmlRequest.send();
var xmlDoc = xmlRequest.responseXML;
document.write("<table style='width: 100%; background-color: #334; color:#fb5;'>");
var labels = ["date", "name", "email", "qq", "phone", "sug"];
document.write("<tr>");
for (var index in labels) {
document.write("<td>" + labels[index] + "</td>");
}
document.write("</tr>");
var person = xmlDoc.getElementsByTagName("person");
for (var index in person) {
var thePerson = person[index];
document.write("<tr>");
for (var x in labels) {
var theTarget = thePerson.getElementsByTagName(labels[x])[0].childNodes[0];
document.write("<td>" + theTarget.nodeValue +"</td>");
}
document.write("</tr>");
}
document.write("</table>");
}
</script>
</head>
<body>
<header>
</header>
<article id="main">
</article>
</body>
</html>