One of the most important aspects of modern unobtrusive DHTML is dealing with events. An event occurs whenever the user interacts with the page in some way – by clicking a link, moving their mouse or typing on the keyboard for example. JavaScript programmers write code to respond to those events, and attach them to specific parts of the page using event handlers.
Sadly, while the modern set of browsers all provide excellent support for most parts of the W3C’s DOM specification, event handling is the one place where significant differences between Internet Explorer and Mozilla/Safari/Opera still exists. Microsoft are not entirely to blame for this: at the time IE 5 was released, the W3C specification for DOM events had not yet been finalised. Hopefully, IE 7 will support the specification in full in addition to maintaining backwards compatibility with previous versions of IE.
In the meantime, workarounds are needed. Thankfully, there’s plenty of documentation to fill the gap. Todd Ditchendorf recently published two articles on this subject: Equalizing JavaScript Event References across IE and EOMB (Every Other Modern Browser) Part 1: DOM Level 0 Event Handlers and Part 2: Programatically registering Event Handlers. Meanwhile, Scott Andrew’s tried and tested addEvent function has been helping deal with the problem since 2001. PPK’s QuirksMode provides extensive coverage of the various browser event models in existence.
This topic is also covered in detail in Stuart’s upcoming book.
Related posts:
- Implementing Event Latency in JavaScript Craig provides some useful JavaScript code to slow down event...
- Cross-browser JSON Serialization in JavaScript JSON serialization can be incredibly useful, but few browsers support...
- Two More Ways to Do Cross Browser Testing A couple of days ago we brought you a sneak...
- Adobe BrowserLab: Cross Browser Testing Still Teething… Adobe's BrowserLab could take the pain out of testing your...
- IE’s Decline Makes ‘Cross Browser’ More Relevant Four years ago, 9 out of every 10 web users...







I’m awating the arrival of Stuart’s book to read more on these interesting topics. I’m just waiting for it to be released.
April 3rd, 2005 at 3:22 pm
This may be of interest
Object-Oriented Event Listening through Partial Application in JavaScript
April 4th, 2005 at 8:22 pm
All my problems vanished with Mike Foster’s excellent x library from cross-browser.com
April 5th, 2005 at 7:57 am
mierda
May 5th, 2006 at 11:56 pm
All browsers these days support online event registration software. That is of course unless you’re using a browser that’s 5-10 years old in which case you probably shouldn’t be on the internet anyway. I find that with registration forms Firefox handles them the best. Internet Explorer runs a close second.
June 19th, 2008 at 1:32 pm