|
Posted by Julien CROUZET on 02/18/06 16:27
Le 18/02/2006, Andy Dingley a supposé :
> On Sat, 18 Feb 2006 11:38:06 +0000, Dylan Parry <usenet@dylanparry.com>
> wrote:
>
>>> Ye. It looks to me like just plain old javascript doing some stuff to an
>>> innerHTML.
>>
>> How else would you update the page with the new results? Google et al
>> use nothing different in their own AJAX apps.
>
> The honourable cephalod is quite right. ".innerHTML" has no part in
> well-written AJAX work. It's flakey, it's slow and it's going to get
> even more so as we drag slowly towards XML processing on the client
> side.
>
> AJAX is (or should) be about manipulation of the client browser's DOM,
> i.e. the Object Model of the page, as it's in use by the browser and
> long fter it has been rendered from the HTML document. Although it's
> admittedly easy to work with innerHTML and insert some HTML fragments
> into it that way, these need to be parsed by the browser before being
> inserted into the DOM. If your AJAX is building long navigation browse
> lists on th efly, then this speed difference can be appreciable.
>
> For XML documents it's even worse, as innerHTML may force the browser to
> flip from an XML DOM into a HTML representation (it might swap back
> again later, if possible). Using innerHTML is _really_ incompatible
> with trying to work in an XML style.
>
>
>>> I thought that AJAX was something different to that.
>
> There's no hard and fast spec for AJAX, so its hard to say just what is
> and what isn't. But using .innerHTML is shoddy coding and I certainly
> don't permit it for new work.
>
> The difference between AJAX and the asynchronous JavaScript and
> XMLHTTPRequest work that was going on back in '99 is that AJAX
> represents a set of well thought out good practice for how to build
> apps. .innerHTML is one of the possibilities that was rejected through
> this tidying up process.
That's true for a big, full AJAX based application, but I'm not sure
that using a > 200ko framework for such a tiny application is such a
good idea.
Just my two cents.
--
Julien CROUZET - DSI Theoconcept
julien.crouzet@/enlever ca\theoconcept.com
http://www.theoconcept.com
[Back to original message]
|