A Basic Standards DOM Event API for IE8
EventShim adds support for addEventListener(), removeEventListener(), and standard Event object properties to IE8's event model.
To write standards-based event code now in IE8 without using a library such as jQuery, MooTools, etc.
The right way: by modifying the DispEventObj's prototype, as well as the HTMLDocument and Element DOM interface prototypes. This approach allows you to "write once."
EventShim is easy to implement.
Step 1: Clone the repo
$ git clone firstname.lastname@example.org:jwmcpeak/EventShim
Step 2: Load the Script
The goal of EventShim is to make writing cross-browser event code painless and transparent. Naturally, it is impossible to replicate 100% of the DOM3 Event API in IE8, but the following lists the properties and methods added to the DispEventObj interface.
EventShim also adds addEventListener() and removeEventListener() to the following objects and/or interfaces:
This covers all use-cases.
- There is no capture. It's IE, remember?