[thelist] javascript default event handlers, default events.
Hershel Robinson
hershelr at netvision.net.il
Wed Aug 31 10:20:03 CDT 2005
> id and class have nothing to do with style.
This certainly seems correct to me.
>>Taking out all behaviour references from our markup doesn't achieve this.
>>Yes we have nice & clean markup, but our code is a lot dirtier.
The markup is without question cleaner (with all the inherent advantages
of such) but the code need not be 'a lot' dirtier, nor any dirtier in
fact. It may need to written in a different fashion, but the
determination of method of assigning attributes to page objects should
not influence the ability of a programmer to write clean code. In fact,
one could suggest that having all event handler assignments in the same
place as the rest of the JS code will provide certain advantages with
regards to clarity and maintenance of the JS code..
> No. *Applying style* by class or by tag name or by id is better than
> using inline style. But you misunderstand when you say that class has
> anything to do with style. It is a way of grouping elements.
I do believe this is correct. I have indeed written HTML pages where the
assignment of an id to an element was not driven by any CSS need and
that id is in fact not actually styled in the CSS. The id is needed by
the JS code. This id is part of the information contained in the HMTL
and is thus not necessarily an indication of style nor
functionality--it's information. Based on that information, the CSS can
apply style and the JS can apply functionality.
Hershel
More information about the thelist
mailing list