Paul,
I haven't had a chance yet to take a look at your Plugin. I intend too,
I'm just a little busy getting back into the swing after most of last
week out the window with YAPC and Canada day on friday.
I've previously done some C::A work with XMLHttpRequest and based my
code off the SAJAX stuff to, although mine wasn't in plugin format.
Here's the mailing list archive:
http://www.mail-archive.com/cgiapp@lists.erlbaum.net/msg03078.html
My test code is running at:
http://www.unobserved.org/misc/rs/
Not sure whether or not there are differences / similarities in our
code, but if you are intending on moving ahead with a C:A:P:Ajax plugin
I'd be more then willing to collaborate with you on it.
---
Steve Comrie
Paul Campbell wrote:
I'm interested in any feedback anyone might have for this module.
More information:
http://kemitix.net/bitware/2005/07/02/cgiapplicationpluginajax-v002/
Download the code, including demo:
http://kemitix.net/files/cgiapp/CGI-Application-Plugin-AJAX-0.02.tar.gz
###
The buzzword of the moment in web development would appear to be
'AJAX'. Basically it is the use of the JavaScript accessible object
XMLHttpRequest to update the current webpage without have to go
through a complete, and expensive, page refresh cycle with the remote
server. Instead using XMLHttpRequest's asynchronous behaviour and an
appropriate JavaScript callback the updates are performed in the
background. Indeed several could be going on simultaneously.
What I have attempted here with CGI::Application::Plugin::AJAX is to
create a proof of concept that implements a flexible AJAX framework
into a CGI::Application module. The JavaScript comprising the core of
the AJAX client is a modification of [1]SAJAX.
[1] http://www.modernmethod.com/sajax/
I have a standard run-of-the-mill [2]demo. It implements what appears
to be the Hello World of AJAX: Multiply and Divide. There is also a
File Uploader. (Note: the file uploaded sends the file back to you, so
don't upload anything too large, neither you nor I will like it.)
[2] http://kemitix.net/cap-ajax/
Run modes are registered together with the JavaScript involved:
AJAX_register_run_mode
(
'multiply' =>
{
# what element to attach the event to
id => 'btnMultiply',
# which event to attach to - onclick is the default if not given
event => 'onclick',
# what to do when the above event it triggered
trigger => "
var term1 = ajax_elid('term1').value;
var term2 = ajax_elid('term2').value;
",
# which CGI parameters are passed using which values
# a parameter can be associated with an array for multiple values
cgiargs =>
{ # map the cgi argument names to the values
# gathered by the trigger
term1 => 'term1',
term2 => ['term2'],
},
# Once the server replies, this is what we do with the answer
callback => "
ajax_elid('result').innerHTML = '= ' + result;
ajax_elid('symbol').innerHTML = '*';
",
}
);
NOTE: Although I have named this module within an existing Namespace,
I am not claiming it. I'm open to suggestions for a more appropriate
name for the plugin.
Thanks for any comments you can give.
--
Steve Comrie
LEAD SOFTWARE ARCHITECT | OCTANE
T: 416.977.2525
F: 416.977.8481
355 ADELAIDE ST. W. SUITE 1B
TORONTO, ONTARIO M5V 1S2
WWW.OCTANE.TO <http://www.octane.to>