[TYPO3-dev] standard TYPO3 ajax framework

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Jul 17 13:08:52 CEST 2006


Martin Kutschker schrieb am 17.07.2006 12:57:

>> What is the sense in building an own lib, when there are so many good
>> ones
>> available and thingis develp so rapidly? Who should build and maintain
>> it?
> 
> I fear (and I may be wrong here) that those libs tend to do everything
> including the rendering of the HTML elements.

No fear here. To make it short:

The xajax framework just has two pieces (classes):

a) the main object is used to create "wrapper" javascript functions that
you can embed in your regular XHTML-output. So when the user presses a
button you code it to fire "xajax_buttonPressed" javascript code (which
you don't have to code yourself, which is the huge advantage of using
the framework!). Only thing you need to do is to make sure the xajax
javascript-code is loaded before ($xajax->printJavascript()).

b) you then implement the PHP "buttonPressed" function in your ajax
responder. You must just create a xajaxResponse object where you can
define what will happen on the javascript side (you change some
XHTML-fragment, you execute some javascript, etc). The framework will
take care of parsing the response and acting acordingly (you don't need
to code anything here for this to work, too!).

So basically you have all freedoms, but you don't have to worry about
any XML parsing, javascript handling and stuff.


Cheers,
Ernesto




More information about the TYPO3-dev mailing list