Tuesday, August 30, 2005

Know your (event) sources

A loooong time ago I wrote this tutoral on JavaScript events, in which I included a cross-browser event handling script called addEvent.

Today, Peter-Paul Koch: addEvent Considered Harmful. And he's right, you can get into all kinds of headaches using IE's attachEvent method, as my own addEvent snippet does. Be sure to read the ensuing comment thread for some interesting alternative approaches.

Caveat implementor, my friends.

PS: I'm rather pleased that something I wrote merits a "considered harmful" treatise! I'm in good company.


At 10:17 AM, Blogger Isofarro said...

Thanks for creating these functions in the first place. They were - and still are - a great starting point for writing unobtrusive JavaScript. Hopefully there'll be a fix found for "this" particular problem.

At 12:08 AM, Blogger My VoIp Solutions said...

Hi Thanks for your interesting blog. I also have a blog/site, covering buster voip related stuff. Feel free to visit my buster voip site.

At 11:07 AM, Blogger Imran Hashmi said...


Please can any one help me to manage a stick up footer on the website for IE 5.0 +. I Think its with CSS or Javascript r both.

As you can see 1 on http://www.bmw.co.uk


Imran Hashmi


Post a Comment

<< Home