comparison BoosterPack/scripts/.svn/text-base/pjx_url.pl.svn-base @ 0:0d795f02a8bb tip

initial committ. what was I thinking?
author Robert McIntyre <rlm@mit.edu>
date Mon, 27 Sep 2010 16:57:26 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0d795f02a8bb
1 #!C:/strawberry/perl/bin/perl.exe
2
3 # this is an example script of how you would use URLs to define
4 # your CGI::Ajax functions.
5
6 use strict;
7 use CGI::Ajax;
8 use CGI;
9
10 my $q = new CGI;
11
12 # the format here implies that 'convert_degrees.pl' is at the same
13 # level in the web server's document root as this script.
14 my $pjx = CGI::Ajax->new( 'myfunc' => 'convert_degrees.pl');
15 $pjx->JSDEBUG(1);
16
17 my $Show_Form = sub {
18 my $html = "";
19 $html .= <<EOT;
20 <HTML>
21 <HEAD><title>CGI::Ajax Outside URL Example</title>
22 </HEAD>
23 <BODY>
24 <form>
25 Degrees Centigrade:&nbsp;
26 <input type="text" name="val1" id="val1" size="6"
27 onkeyup="myfunc( ['Centigrade__' + getVal('val1')], ['val2'] );
28 return true;">
29 <br/>
30
31 Degrees Kelvin:&nbsp;
32 <input type="text" name="val2" id="val2" size="6"
33 onkeyup="myfunc( ['Kelvin__' + getVal('val2')], ['val1'] );
34 return true;">
35 </form>
36 </BODY>
37 </HTML>
38 EOT
39
40 return $html;
41 };
42
43 print $pjx->build_html($q,$Show_Form); # this outputs the html for the page