/[ht-ajax]/test/test-ajax.tmpl.html
ViewVC logotype

Contents of /test/test-ajax.tmpl.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Fri Nov 14 21:17:43 2008 UTC (5 years, 5 months ago) by xlopez
File MIME type: text/html
File size: 2813 byte(s)
Initial commit, version 0.0.7.
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 ;;;
4 ;;; Copyright (c) 2007, Ury Marshak
5 ;;; The code comes with a BSD-style license, so you can basically do
6 ;;; with it whatever you want. See the file LICENSE for details.
7 ;;;
8 -->
9 <head>
10 <title>HT_AJAX Test page</title>
11 <!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
12 <style type="text/css">
13 <!--
14 .header1 {
15 background-color: #FFFFCC;
16 font-size: x-large;
17 font-weight: bold;
18 border-width: 2;
19 }
20 body {
21 background-color: #FFCC99;
22 }
23 .main {
24 background-color: #FFFFCC;
25 }
26
27 table {border:none}
28 td {border:none}
29 fieldset {border:none}
30
31 table.jsontable {
32 border: 1px solid;
33 cellspacing:3px;
34 cellpadding:5px;
35 background-color: #FFCC77;
36 }
37 .jsontable td {
38 border: 1px solid;
39 text-align: right;
40 }
41 -->
42 </style>
43 </head>
44
45 <body>
46 <!-- TMPL_VAR prologue -->
47 <noscript><h1 style="color:red;">This page requires Javascript</h1><br /></noscript>
48
49 <div class="header1"><h3 style="text-align:center;" class="header1">Test</h3>
50 </div>
51 <script type="text/javascript">
52 function ajax1() {
53 var s = function (res) {
54 el = document.getElementById('res');
55 el.innerHTML = res;
56 }
57 var e = function (info) {
58 debug_alert('Handler caught error: '+info)
59 }
60 ajax_get_counter_callback([s, e]);
61 }
62 </script>
63 <a href="javascript:ajax1();">GET COUNTER</a>
64 <br />
65 <span id="res">text</span>
66
67 <hr />
68
69 <br />
70 <br />
71 <table width="50%">
72 <tr>
73 <td colspan="2">
74 <span id="result"> <i>no results yet</i>
75 </span>
76 </td>
77 </tr>
78 <tr>
79 <td width="70%">
80 <input type="text" size="70" name="command" id="command" />
81 </td>
82 <td>
83 <input type="button" value="Eval" onclick="javascript:command_clicked();"/>
84 </td>
85 </tr>
86 </table>
87
88 <br />
89 <script type="text/javascript">
90 function command_clicked(txt) {
91 // get the current value of the text input field
92 var command = document.getElementById('command').value;
93
94 // call function testfunc on the server with the parameter
95 // command and set the element with the id 'result' to the return
96 // value of the function
97 ajax_testfunc_set_element('result', command);
98
99 }
100 </script>
101
102
103
104 <hr />
105 <script type="text/javascript">
106 function do_test_json() {
107 ajax_testjson_callback(function (obj) {
108 document.getElementById("object-p").innerHTML=obj.p;
109 document.getElementById("element-of-object-p").innerHTML=obj.p[3];
110 });
111 }
112 </script>
113 <p>Test JSON</p>
114 <br />
115 <table class="jsontable">
116 <tr>
117 <td>&nbsp;</td>
118 <td>object.p</td>
119 <td>object.p[3]</td>
120 </tr>
121 <tr>
122 <td onclick="do_test_json();" style="background-color: #EE7777">Click here</td>
123 <td id="object-p">&nbsp;</td>
124 <td id="element-of-object-p">&nbsp;</td>
125 </tr>
126 </table>
127 <br />
128
129
130 <hr />
131 <p>This is just a test page</p>
132 <hr />
133 </body>
134 </html>

  ViewVC Help
Powered by ViewVC 1.1.5