view scripts/pjx_nobuild.pl @ 10:3b52ac950753 boosterpack tip

going to try to fix this thing
author Robert McIntyre <rlm@mit.edu>
date Mon, 27 Sep 2010 17:24:06 -0400
parents 477258d09353
children
line wrap: on
line source
1 #!C:/strawberry/perl/bin/perl.exe
3 use strict;
4 use CGI::Ajax;
6 my $my_func = sub {
7 my $arg = shift;
8 return ( $arg . " with some extra" );
9 };
11 my $pjx = new CGI::Ajax( 'tester' => $my_func );
12 $pjx->JSDEBUG(1);
13 $pjx->DEBUG(1);
15 use CGI;
16 my $cgi = new CGI();
17 print $cgi->header();
19 $pjx->cgi( $cgi );
21 my $html = "";
22 $html .= "<HTML>";
23 $html .= "<HEAD>";
25 $html .= $pjx;
27 $html .= <<EOT;
28 </HEAD>
29 <BODY>
30 <FORM name="form">
31 <INPUT type="text" id="inarg"
32 onkeyup="tester(['inarg'],['output_div']); return true;">
33 <hr>
34 <div id="output_div"></div>
35 </FORM>
36 <br/><div id='pjxdebugrequest'></div><br/>
37 </BODY>
38 </HTML>
39 EOT
41 if ( not $cgi->param('fname') ) {
42 print $html;
43 } else {
44 print $pjx->handle_request();
45 }