[TYPO3-dev] Time for AJAX coordination?

Michael Scharkow mscharkow at gmx.net
Sat Feb 11 19:22:26 CET 2006


Dmitry Dulepov wrote:

> Michael Scharkow wrote:
> 
>>Moreover, you can't use the same controller method for both
>>normal HTML and AJAX output which is also a must IMHO.
> 
> 
> I am not sure that I understand what you mean... I do not really care
> about ancient browser that do not implement xhttprequest object. I think
> they either already dead or dying. Even Opera < 7.60 does not appear too
> often now.

Hi Dmitry,

I meant something different: If I have a method render_page_tree() that 
returns some output (like the page tree in the BE) I want to use the 
very same method to produce a) the initial HTML output (as part of, say, 
the page module) *and* b) update the page tree with an AJAX call.

Since with xajax you always need to return an $objResponse->getXML(), 
you cannot easily use the same method for conventional output, that's at 
least my impression.

> Well, we are talking about ajax library, not about generic JS library.
> We are not going to bring scripaculos to typo3 just because it is fun,
> are we? :)

Why not? What is an AJAX library in our definition: An interface to
a) create JS AJAX calls in PHP code and
b) return XML data back to the AJAX caller in PHP code.

The boilerplate code for the pure XMLHTTPRequest javascript can be found 
in a dozen libraries, including xajax, prototype.js, younameit.js.

What remains is a) getting the return output right and b) making it easy 
to connect links with AJAX calls in the most elegant manner. Or do drag 
and drop, dynamic input completion, etc.

While xajax doesn't help you with this (you have to write stuff like

<a href="#" onclick="xajax_doStuff('my_element'));">Do stuff</a>

yourself, using for example behaviour.js would make the AJAX call even 
less obstrusive because you can get rid of all the onclick=... in your 
HTML. Instead, we'd only include one or two external JS libraries and a 
little function registration code in dynamic JS (see 
http://bennolan.com/behaviour/)

Why not include a generic, well-maintained JS library that can do AJAX 
*and* other niceties which we might need sooner or later, for example 
for our BE tab-dividers, type selectors, drag-drop etc.

Greetings,
Michael




More information about the TYPO3-dev mailing list