RA Jones wrote:

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

In reality, there's almost no integration necessary. AJAX requests from the
browser are identical to normal requests. But they usually do something
different with that data. For instance, a normal form submission will send the
info the server and the server will return a full HTML document.

A form submitted with an AJAX request will send the data to the server and the
server will usually send one of the following back:

A) A partial HTML document
B) an XML file
C) some JSON data

That's pretty straight forward. The next part is where the cool stuff happens.
After the client receives the info from the server it needs to process it. Using
the same cases above:

A) JS usually takes that partial document and injects it into the current page
(in prototype this is done with Element.update).
B) Parse the XML and
  1 - extra data which is used in some way
  2 - use XSLT to transform the XML into HTML
C) use JS eval() to transform the JSON text into a JS object (transparently done
in Prototype) and then use that data in some way.


All of the above is pretty vague, but since AJAX isn't a technology, but a
collection of similar techniques it's usually pretty vague :)

Maybe if you tell us a specific task you're trying to accomplish we can help you
out better and maybe even give you real code :)

-- 
Michael Peters
Developer
Plus Three, LP


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