On Thursday 19 October 2006 11:12, RA Jones wrote:
> Michael Peters wrote:
> >  IMO, saying you want to learn AJAX without learning JS is like saying
> >  you want to learn web programming without learning HTML and HTTP.
> >  Sure there are probably frameworks out there that will hide those
> >  details from you, but sooner or later you're gonna have to get your
> >  hands dirty, or suffer the consequences :)
>
> Exactly what I feared, but fully appreciate the analogy. I've had a
> quick look at prototype.js
> and also jQuery and its tutorial, but it all seems very mysterious, and
> not at all clear how it can be integrated into a CGI::App.

The prototype.js is simply included in your template, either as text or as a 
link.  Then, you use its functions in your HTML markup (in your template).  
The only trick to making an AJAX call is to write a run_mode in your CGI::App 
that returns something that the AJAX call understands.  This can be as simple 
as returning a snippet of HTML (but not the whole page, as your run_modes 
usually do) or can be JSON or XML.  So, the integration is not really into 
the CGI::App (except for the minor modification to any run_mode that is going 
to return to an AJAX call) and inclusion of the prototype.js code in your 
HTML and finally including the code to make the actual AJAX call from your 
HTML page.  

Sean

---------------------------------------------------------------------
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