view scripts/pjx_from_span.pl @ 1:c702488ef795 boosterpack

[svn r3] modified
author robert
date Mon, 31 Aug 2009 14:53:15 -0400
parents 477258d09353
children
line wrap: on
line source
1 #!C:/strawberry/perl/bin/perl.exe
3 use strict;
4 use warnings;
6 use CGI;
7 use CGI::Ajax;
9 my $cgi= CGI->new;
11 my $a= CGI::Ajax->new(
12 'test_elt_html' => \&test_elt_html
13 );
15 $a->DEBUG(2);
16 $a->JSDEBUG(2);
18 print $a->build_html( $cgi, \&html_page);
20 sub html_page
22 {
23 return <<EOH;
24 <html>
25 <head>
26 <script>
27 function test2(){
28 alert(typeof document.getElementById('newtest'));
29 }
30 </script>
32 </head>
34 <body>
35 <div id="test_div">test with div</div>
36 <p><span id="test_span">test with span</span></p>
37 <p id="test_p">test with p</p>
39 <div id='newtest' > some stuff </div>
40 <hr />
42 <p><input type="button" onclick="test_elt_html( [ 'test_div' ], [ 'test_result_div' ]);" value="test div"></p>
43 <div id="test_result_div"></div>
45 <p><input type="submit" onclick="test_elt_html( [ 'test_span' ], [ 'test_result_span' ]);" value="test span"></p>
46 <div id="test_result_span"></div>
48 <p><input type="submit" onclick="test2();test_elt_html( [ 'newtest' ], [ 'test_result_p' ]);" value="test p"></p>
49 <div id="test_result_p"></div>
51 </body>
52 </html>
53 EOH
54 ;
56 }
59 sub test_elt_html
60 { my( $elt_html)= @_;
61 print STDERR "IN:" . $elt_html , "\n";
62 return $elt_html;
63 }