I have prepared another example on infocopter.ch/ajax.html
Prerequisites
cpan> install CGI::Ajax
Download files/ajax cgi.txt
#!/usr/bin/perl -w
use strict;
$| = 1;
###############################################
# Location:
# http://www.infocopter.com/perl/ajax.html
###############################################
use CGI::Ajax;
use CGI;
my $q = CGI->new();
##### GLOBAL
my $Google_pattern_l = q~http://www.google.ch/custom?domains=www.infocopter.com&q=~;
my $Google_pattern_r = q~&sitesearch=www.infocopter.com&sa=Suchen&client=pub-2462448779608523&forid=1&channel=7029886459&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%239A2C06%3BGL%3A1%3BDIV%3A%2333FFFF%3BVLC%3AD03500%3BAH%3Acenter%3BBGC%3AFFFFCC%3BLBGC%3AE6E6E6%3BALC%3A440066%3BLC%3A440066%3BT%3A336699%3BGFNT%3A223472%3BGIMP%3A223472%3BLH%3A25%3BLW%3A106%3BL%3Ahttp%3A%2F%2Fwww.infocopter.com%2Fimages%2Flogo-ic-vsma.gif%3BS%3Ahttp%3A%2F%2F%3BFORID%3A1%3B&hl=de~;
my $Show_Form = sub {
my $html = '';
$html = q~<html>
<head>
<title>Ajax Demo</title>
<link href="/mainwiki.css" rel="styleSheet" type="text/css">
</head>
<body>
<img src="/images/redpoint.gif" width="9" height="9" alt="You are here"> <a href="http://www.infocopter.com/">iC Home</a> >
<a href="http://www.infocopter.com/perl/">Perl</a> >
<a href="http://www.infocopter.com/perl/documentation.html"> Documentation</a> >
<a href="http://www.infocopter.com/perl/ajax.html">Ajax</a> > Demo
<br /> <br />
<h3>Ajax Demo</h3>
<form name="myForm">
<b>Input:</b> <input type="text" name="searchq" id="searchq" size="16"
onkeyup="search( ['searchq'], ['rdiv'] ); return true;">
Try: foo or reto<br><br>
<span id="rdiv"></span>
</form>
<script language="JavaScript">
document.myForm.searchq.focus();
</script>
</body>
</html>~;
$html;
};
&main();
sub main() {
my $search_fx = sub {
my $in = shift || '* no val *';
my $html = '';
return $html if length($in) < 2;
my $ret = '';
open(IN, '<ajax_input.txt') or print STDERR $!;
while(<IN>) {
if ($_ =~ /$in/i) {
chomp;
my ($key, $val) = split /\t/;
(my $qsafe_val = &uri_escape($val)) =~ s/%/%25/g; # keep '%'
$ret .= qq~$key →
<a href="$Google_pattern_l$qsafe_val$Google_pattern_r">
$val</a><br>~;
}
}
close IN;
$html .= $ret ? '<b>Found results:</b><br>' . $ret : '';
$html .= q~<br><a href="http://primus.pgate.net/ajax/linksearch/">Ajax Link Search</a>~;
$html;
};
my $pjx = CGI::Ajax->new(
search => $search_fx,
);
$pjx->JSDEBUG(0);
$pjx->DEBUG(0);
print $pjx->build_html($q, $Show_Form); # this outputs the html for the page
}
sub uri_escape {
my $text = $_[0];
# Build a char to hex map
my %escapes = ();
for (0..255) { $escapes{chr($_)} = sprintf("%%%02X", $_); }
# Default unsafe characters. RFC 2732 ^(uric - reserved)
$text =~ s/([^A-Za-z0-9\-_.!~*'()])/$escapes{$1}/g;
$text;
}
Try it out:
primus.pgate.net/ajax/↑
See also:
-
Zimbra Collaboration Suite
- Software CInternet:Webmaster
Zimbra is an open source, next-generation messaging and collaboration software. We built Zimbra Collaboration Suite (ZCS) with the belief existing email and calendaring solutions are broken- the result is an innovative experience for end-users and system administrators.
zimbra.com/
-
Ajax Technologies




- Reference CInternet:Webmaster
The XMLHttpRequest Object.
w3schools.com/xml/xml_http.asp
-
AJAX Desktop Tutorial - Overview

- Reference CInternet:Webmaster
How to create an AJAX homepage - step-by-step
musestorm.com/web/jsp/tutorials/ad_tutorial.jsp
-
Ajax @ Perl








- Reference Perl
Ajax Demos in Perl
perljax.us/demo/
-
Know-how: Perl and Ajax









- Reference Perl
Ajax with Perl
infocopter.com/perl/ajax.html
-
Backbase / Ajax - CInternet:Webmaster Downloads
Create more user-friendly web applications in record-time. The Backbase framework has many user interface controls and code samples, and advanced development tools. Backbase supports all main web browsers, without the need for a plug-in
backbase.com/start/
-
telerik.com/Default.aspx?PageId=2694 - Reference
How does AJAX work
telerik.com/Default.aspx?PageId=2694