forked from SuperIRis/AEParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
37 lines (34 loc) · 986 Bytes
/
example.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>AEParser</title>
</head>
<body>
<form id="parse_form">
<textarea cols="80" rows="20" id="ae_content" name="ae_content"></textarea>
<p><input type="submit" value="Parse" id="submit_btn" /></p>
</form>
<textarea cols="80" rows="20" id="ae_result" name="ae_result"></textarea>
<script src="AEParser.js"></script>
<script>
var parserExample = function()
{
var submitForm = function(e)
{
if(e) e.preventDefault();
var aeJson = AEParser.parse(document.getElementById("ae_content").value);
document.getElementById("ae_result").value = JSON.stringify(aeJson,null,'\t');
};
return {
init:function()
{
form = document.getElementById("parse_form");
form.onsubmit = submitForm;
}
};
}();
window.onload = parserExample.init;
</script>
</body>
</html>