/[svn]/web/demo.html
ViewVC logotype

Contents of /web/demo.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1384 - (show annotations)
Tue Jul 10 18:44:36 2007 UTC (5 years, 10 months ago) by abate
File MIME type: text/html
File size: 1154 byte(s)
[r2004-12-28 00:57:04 by afrisch] Demo

Original author: afrisch
Date: 2004-12-28 01:00:14+00:00
1 <!-- http://jibbering.com/2002/4/httprequest.html -->
2 <html>
3 <head><title>CDuce demo</title></head>
4 <body>
5
6 <h1><a href="http://www.cduce.org/">CDuce</a> online demo</h1>
7 <table width="100%" border="1">
8 <tr>
9 <td width="50%" valign="top">
10 <input type="submit" value="Evaluate" onclick="submit('a');"/>
11 <input type="button" value="Clear" onclick="clearreq('a');"/>
12 <textarea id="areq" cols="80" rows="25">
13 let x = 1;;
14 </textarea>
15 <br/>
16 </td>
17 <td width="50%" valign="top" onmousedown="show_result('a','');">
18 <input type="button" value="Clear" onclick="show_result('a','');"/>
19 <pre><div id="ares"></div></pre>
20 </td>
21 </tr>
22 </td>
23 <script type="javascript">
24
25 function clearreq(pr)
26 { document.getElementById(pr+"req").value = ""; }
27
28 function show_result(pr,res)
29 { document.getElementById(pr+"res").innerHTML = res; }
30
31 function submit(pr) {
32 var xmlhttp = new XMLHttpRequest();
33 xmlhttp.open("POST", "/cgi-bin/evaluator" ,true);
34 xmlhttp.onreadystatechange=function() {
35 if (xmlhttp.readyState==4) { show_result(pr,xmlhttp.responseText); }
36 }
37 show_result(pr,"Computing...");
38 xmlhttp.send(document.getElementById(pr+"req").value);
39 }
40
41
42 </script>
43 </body>
44 </html>

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5