[thelist] AJAX Tip

Christian Heilmann codepo8 at gmail.com
Thu Apr 6 08:16:49 CDT 2006


> OK, how do you not use the DOM to do DHTML these days?

Who claimed I wanted to do that? The DOM is there to reach things in
the markup with it. Why add your code in the markup and mix structure
and behaviour when you don't have to?

> > > <a href="picture.jpg" onclick="return showPicture(this, 'picture.jpg
> > ');"><img
> > > > src="thumbnail.jpg" /></a>
> > >
> > > That is the part that is not unobtrusive.  There should not be JS in
> > > the markup.
>
> Exactly. Unobtrusive JavaScript should be unobtrusive to both the user
> > and the maintainer.
>
> Moving the coupling between presentation and behaviour to your JavaScript is
> no easier to maintain (or harder).  The benefits are generally academic.
> *Except* for generic scripts that are designed for easy reuse, but most
> scripts depend on some form of hook into the markup.

I know many CMS that allow you to apply a class to a link, but not
many (good ones that do manage content instead of create web sites)
that allow you to add own inline event handlers.

If you want to edit misspellings and get a change request every time
some content has to change be my guest, I'd rather have an editor with
a short period of training be able to add something like an image
popup in a CMS by applying a class or select a plugin than mess around
with my code.

So, yes, these are generic, but what is the use in bespoke development
of functionality that needs to be used over and over again anyways?
How many more menu scripts do we need?

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/



More information about the thelist mailing list