[tpm] TPM talk suggestions

adam.prime at utoronto.ca adam.prime at utoronto.ca
Fri Apr 18 09:06:26 PDT 2008


Quoting Fulko Hew <fulko.hew at gmail.com>:

> Hijacking this thread...
>
> Can we have a talk on simple AJAX in Perl?
> I know Kees gave us a talk, but I'm just wanting to do simple RPC
> and something like dynamically updating a table, or portion of a screen.
>
> I must be stupid, but I've hit a bump in the learning curve.

The server side of AJAX isn't really that much different than the  
server side of CGI really.  you just take a request and compose a  
response.  Depending on what javascript library you are using (if you  
are using one at all) will determine what your page generates.  It  
could be XML, it could be html, it could be JSON, it could be anything.

The "hard" (or potentially hard) part is the javascript, but most of  
the ajax i've written was for the mootools library, and the actual JS  
boils down to this:

new Ajax(url, {
     method: 'get',
     update: $('replace_me')
}).request();

Which just fetches the URL 'url', and stuffs whatever it gets back  
from that URL into the element with the ID replace_me.  Obviously this  
is a pretty simple example of ajax, but it's a start.

Adam




More information about the toronto-pm mailing list