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

Kowalkowski, Lee (ASPIRE) lee.kowalkowski at hmrcaspire.com
Wed Aug 31 10:27:12 CDT 2005


> -----Original Message-----
> From: VOLKAN ÖZÇELIK [mailto:volkan.ozcelik at gmail.com]
> Sent: Wednesday, August 31, 2005 4:10 PM
>    
> eh.addEventListener(document.getElementById("foo"),"click",foo_click);
>    
> eh.addEventListener(document.getElementById("bar"),"click",bar_click);
>    
> eh.addEventListener(document.getElementById("baz"),"click",baz_click);
> }
> 
> So it is neat, events are attached at a single place. Behavior is
> separated from code. It is easy to maintain (imho) since you know what
> code belongs to where.
> 
> That is, as long as you follow some logic and some conventions, it is
> even easier (imho) to add/ammend/remove event handling logic on the js
> side.

Thanks Volkan, 

Behaviour separated from code?  That I'd like to see!  ;-)  I know what you
meant.

I'm uneasy about the opinion that all those getElementById calls are a true
separation of presentation and behaviour though, that's what troubles me.

I'd agree that if you could achieve an enterprise-wide convention of that
nature it would be acceptably maintainable.

- LK


===========================================================
Our e-mail domain has now changed from iraspire.com to hmrcaspire.com. Please update your address books.
===========================================================



More information about the thelist mailing list