[thelist] AJAX Tip
James Conley
Conleyj at kubota-kma.com
Thu Apr 6 08:29:18 CDT 2006
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Lee kowalkowski
> Sent: Thursday, April 06, 2006 7:39 AM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] AJAX Tip
>
> On 06/04/06, Christian Heilmann <codepo8 at gmail.com> wrote
> >
> > > It's fine to say something is DOM Scripting if it
> actually use the
> > > DOM,
> > but
> > > not if your doing non-DOM DHTML unobtrusivesly, that
> would be lying.
> >
> > How do you NOT use the DOM when you want to do unobtrusive
> Scripting?
> > Even if it is DOM-1?
>
>
> Hmm, let's see...
>
> <a href="picture.jpg" onclick="return showPicture(this,
> 'picture.jpg');"><img src="thumbnail.jpg" /></a>
>
> perhaps?
>
> Really contrived, but showPicture could be:
>
> function showPicture(elem, src)
> {
> if(typeof elem.innerHTML == 'undefined')
> {
> elem.innerHTML = '<img src='"+src+"' />';
> return false;
> }
> return true;
> }
>
> Okay, that's a pretty lousy example (I'm really ashamed of it
> already), but it's unobtrusive i.e. javacript is not breaking
> the page.
>
> I might have misunderstood the DOM Scripting message, but I
> thought one factor was to discourage the use of innerHTML
> (which is not DOM). Purists would say that if you use
> innerHTML, it's not pure DOM Scripting.
>
> On the other hand, it would be futile to avoid getElementById() or
> getElementsByTagName() in this day and age in order to use
> innerHTML, so yeah, DHTML with absolutely no use of the DOM
> is unlikely. I was being picky.
>
> -- LK
> --
Is the innerHTML function of a document object not part of the "Document
Object Model"?
James c.
More information about the thelist
mailing list