[thelist] javascript default event handlers, default events. [TIP]

Matt Warden mwarden at gmail.com
Wed Aug 31 10:37:27 CDT 2005


On 8/31/05, Kowalkowski, Lee (ASPIRE) <lee.kowalkowski at hmrcaspire.com> wrote:
> > > I'm saying onsubmit="return validate(this)" is like
> > > class="foobar";
> >
> > No. Class has nothing to do with style.
> 
> Thanks again, got it, except, I didn't say it was that time.  I'm saying my
> behaviour is NOT inline, it's in a function nicely tucked away.   Like the
> style rules for 'foobar' are nicely tucked away in the stylesheet.

You're not understanding my point. The point is that class doesn't
have anything to do with style. With style, we use identifiers like
class and id to apply style attributes externally. Hence, style and
structure are separated. You are saying that applying behavior should
be done differently, whereas I am saying it should be done the same
way. Specifically, I mean that elements should be selected in some
manner (id, class, tag name, etc.) via external script (whether it is
a <script src="..."> external script or directly in the head) and
javascript behavior should be applied from JavaScript.

This is directly analogous to how we separate style.

Thanks,

-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list