#!/usr/bin/perl
use warnings;
use strict;
use lib "/home/eric/code/openthought2/lib";
use CGI();
use OpenThought();
my $q = CGI->new();
my $OT = OpenThought->new();
if ($q->param('do_ajaxy_stuff')) {
my ( $fields, $html, $javascript );
$fields->{my_text_box} = "";
$html->{my_html_id_tag} = "
You typed: " . $q->param('my_text_box') . "
";
$javascript = "alert('Hello, the HTML has been updated with your response')";
print $q->header();
$OT->param($fields);
$OT->param($html);
$OT->javascript($javascript);
print $OT->response();
}
else {
print $q->header();
print << "EOT"
HTML was here
EOT
}