summaryrefslogtreecommitdiff
path: root/src/runtime/javascript/minibar/example.html
blob: 55422987defcfa4d579b06466b42d05f78c967e6 (plain)
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>PGF online server example</title>
<style type="text/css">
body { background: #ddd; }
</style>
<script type="text/JavaScript" src="http://www.grammaticalframework.org/src/runtime/javascript/minibar/support.js"></script>
<script type="text/JavaScript" src="http://www.grammaticalframework.org/src/runtime/javascript/minibar/pgf_online.js"></script>
<script type="text/JavaScript">

var server_options={
  grammars_url: "http://www.grammaticalframework.org/grammars/",
  grammar_list: ["Syllogism.pgf"]
}
var pgf_server = pgf_online(server_options);

function call_server() {
  pgf_server.parse("SyllogismEng",document.forms[0].input.value,show_output)
}

function show_output(parsed) {
  document.getElementById("output").innerHTML=parsed[0].trees[0]
}

</script>

</head>

<body>
<h1>PGF online server example</h1>

<form onsubmit="call_server(); return false">
Input:
<input name=input size=50 value="some humans are not human">
<input type=submit value=Parse>

<p>
Output:
<span id=output></span>
</form>


<h2>Documentation</h2>
<ul>
  <li><a href="gf-web-api-examples.html">GF Web API examples</a>
</ul>

<hr>
<address></address>
<!-- hhmts start --> Last modified: Mon Apr 11 14:53:21 CEST 2011 <!-- hhmts end -->
</body> </html>