[whatwg] On separation of code and data

On Thu, 07 Jun 2007 16:00:59 +0200, Jerason Banes <jbanes at gmail.com> wrote:
> You may know this already, but the on* handlers have been deprecated and
> replaced with the DOM 2 Events* standard. So instead of doing 'onclick =
> "DoFunction()"' the programmer should be calling
> "element.addEventListener('click',
> DoFunction, false)". If I understand you correctly, this effectively
> achieves your "no code in data" request. At least as far as the standards
> go.

Hmm. I'm not quite convinced that using addEventListener is always better.  
It's much more convenient to have event listeners in the markup. It also  
makes sense if it's just a part of the application.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Thursday, 7 June 2007 07:35:58 UTC