# Code snippet for Web Programming at 2013/10/23,
# slide at http://zoro.ee.ncku.edu.tw/wp2012/res/06-ajax.pdf
################################################################################
# index.html
Ajax demo
initial content
################################################################################
# do (CGI program)
#!/usr/bin/perl -w
use strict;
use CGI;
my $cgi = new CGI;
my $id = $cgi->param('id');
sleep 3; # pretend a long response time to show the loading message
print "Content-type: text/plain\n\n"; # watch out the content type
print "$id, nice to meet you."; # we still return HTML, since the handler
# use it as HTML
# vi:nowrap:sw=1:ts=1