robert@0: #!C:/strawberry/perl/bin/perl.exe robert@0: robert@0: robert@0: use CGI::Ajax; robert@0: use CGI; robert@0: robert@0: my $q = new CGI; robert@0: robert@0: robert@1: my %hash = ( 'card_list' => \&CardList, 'display_card' => \&DisplayCard , 'tags' => \&getAllTags); robert@0: robert@0: robert@0: robert@0: robert@0: my $pjx = CGI::Ajax->new(%hash); robert@0: $pjx->JSDEBUG(1); robert@0: $pjx->DEBUG(1); robert@0: print $pjx->build_html($q,\&gen); # this outputs the html for the page robert@0: robert@0: robert@0: robert@0: robert@0: robert@1: sub getAllTags robert@0: { robert@0: return 14; robert@0: }; robert@0: robert@0: robert@0: robert@1: sub DisplayCard robert@0: { robert@0: return 13; robert@0: }; robert@0: robert@0: robert@1: sub CardList robert@1: { robert@1: robert@1: return 15; robert@1: robert@1: }; robert@0: robert@0: robert@0: sub gen robert@0: { robert@0: open FILE, " }; robert@0: };