[Javascript] DOM vs AJAX

Rakesh Pai rakeshpai at gmail.com
Tue Jun 20 05:10:17 CDT 2006


The DOM and Ajax have nothing to do with each other. One is to create
dynamic form elements using browser API, the other is to download bits
of data from the server.

In an ideal setup, you'd use both - Ajax to get data from the server
(typically as JSON, or you might prefer XML or even plain strings),
and the DOM to render this fetched data on the client.

On 6/20/06, Matt Warden <mwarden at gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael Borchers wrote:
> > with DOM i'd have to really create every element,
> > but with AJAX i would simply store the elements in a seperate file
> > and then import it into a <div>.
>
> You are injecting serialized representations of elements into an already
> unserialized document tree.
>
> > seems much easier ans quicker to me.
>
> It is quicker (for now). And it is easier for someone who already knows
> (X)HTML.
>
> > any disadvantages?
>
> Higher maintainability costs. Less standardization in working with
> documents (you use innerHTML for (X)HTML documents, but must use DOM for
> others).
>
> Those are the ones I like, but no innerHTML-lover ever seems to buy them.
>
> For everyone else, I point them here:
>
> http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp
> http://msdn.microsoft.com/workshop/author/tables/buildtables.asp
>
> If it feels dirty, it probably is.
>
> - --
> Matt Warden
> Oxford, OH, USA
> http://mattwarden.com
>
>
> This email proudly and graciously contributes to entropy.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFEl7nxrI3LObhzHRMRAlFDAJoCQUhH2XrnKva0AmX8UF5OU3uFdQCgl42P
> gCfEkhkmqLbMfKi6n8swrRk=
> =9Qso
> -----END PGP SIGNATURE-----
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>


-- 
Rakesh Pai
Mumbai, India.
rakesh.pai at gmail.com
http://piecesofrakesh.blogspot.com/



More information about the Javascript mailing list