forked from mjstrobl/WEXEA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wexea.html
68 lines (61 loc) · 1.51 KB
/
wexea.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
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<head>
<style>
a {
color: #2c87f0;
}
.annotation {color: blue;}
.annotated {color: red;}
.unknown {color: green;}
.coref {color: purple;}
</style>
<title>WEXEA</title>
</head>
<body>
<script type="text/javascript">
function xml_http_post(url, data, callback) {
var req = false;
try {
// Firefox, Opera 8.0+, Safari
req = new XMLHttpRequest();
}
catch (e) {
// Internet Explorer
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
req.open("POST", url, true);
req.onreadystatechange = function() {
if (req.readyState == 4) {
callback(req);
}
}
req.send(data);
}
function test_button() {
var data = document.test_form.test_text.value;
xml_http_post("frontend.html", data, test_handle)
}
function test_handle(req) {
console.log(req.responseText);
document.getElementById("content").innerHTML = req.responseText;
}
</script>
<form name=test_form>
<!-- <textarea name="test_text" cols="40" rows="5"></textarea> -->
<input type="text" id="test_text" name="test_text">
<input type=button onClick="test_button();" value="start" title="start">
</form>
<div id="content"></div>
</body>
</html>