comparison scripts/pjx_from_span.pl @ 0:477258d09353 boosterpack

[svn r1] initial import
author robert
date Sun, 30 Aug 2009 02:19:26 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:477258d09353
1 #!C:/strawberry/perl/bin/perl.exe
2
3 use strict;
4 use warnings;
5
6 use CGI;
7 use CGI::Ajax;
8
9 my $cgi= CGI->new;
10
11 my $a= CGI::Ajax->new(
12 'test_elt_html' => \&test_elt_html
13 );
14
15 $a->DEBUG(2);
16 $a->JSDEBUG(2);
17
18 print $a->build_html( $cgi, \&html_page);
19
20 sub html_page
21
22 {
23 return <<EOH;
24 <html>
25 <head>
26 <script>
27 function test2(){
28 alert(typeof document.getElementById('newtest'));
29 }
30 </script>
31
32 </head>
33
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>
38
39 <div id='newtest' > some stuff </div>
40 <hr />
41
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>
44
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>
47
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>
50
51 </body>
52 </html>
53 EOH
54 ;
55
56 }
57
58
59 sub test_elt_html
60 { my( $elt_html)= @_;
61 print STDERR "IN:" . $elt_html , "\n";
62 return $elt_html;
63 }
64