[TYPO3-hci] AJAX: serverside logic vs. clientside logic

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Fri Sep 15 04:59:12 CEST 2006


Hello,

I fear I need to reopen the discussion about AJAX libraries, because
some thoughts came into my mind, that I think are very important.

With xajax and prototype we compare two representatives of a lot of ajax
libraries that follow two completly different philosophies.

The xajax type does all logic on the server side with PHP.
The prototype type does the logic on the client side with JS.

Please correct my if I am wrong, I have no own experiences with prototype.


1.) What happens if JavaScript is turned off?

The xajax type will do it's regular, full work as a traditional webpage,
because the logic is on the servers side.

The prototyp type will fully break and becomes unusable.


2.) Form validation:

We agree that we need form validation within the browser (AJAX) for the
users comfort but also after submission of forms on the servers side for
reasons of security. How many times do we need to program validation now?

With the xajax type we need to program validation once, because the
validation within the browser uses the PHP logic on the servers side.

With the prototype type we need to program validation twice, once on the
client side, once on the server side. The work doubles.


3.) Accessibility:

Some Screenreaders don't support javascript at all. Other screenreaders
only support JS if it is specially used. DOM alterations are only
allowed to happen behind the point of execution, because screenreaders
read xhtml in a linear way.

It is hard to program JS in this special way, that it is usable for
screenreaders. It is easy to program a website in a way, that it works
when JS is turned off.

If we want to reach, that we can turn of JS for accessibility, we have
no additional work with the xajax type.

With the prototype type, we have to programm all the logic a second time
with PHP on the servers side. Again the work doubles to gain
accessibility with the prototype type.


Conclusions:
============

1.) The logic should stay on the servers side whereever possible, which
means that the xajax type should be the preferred type of AJAX for the
overall usage.

2.) There are very rare cases where clientside AJAX can enable some
additional features. But this features can only be nice little addons.
The pages fundamental functionality should never depend on clientside
AJAX logic.


The discussion is open again.


Regards

Elmar





























More information about the TYPO3-team-hci mailing list