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.

-- 
Paul Campbell
<[EMAIL PROTECTED]>
http://kemitix.net/bitware/

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to