annotate scripts/pjx_nobuild.pl @ 9:9652dc713ba6 boosterpack

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