addEvent() recoding contest entry

Remove border effect.


The code was built using the most simple JavaScript methods to avoid dependencies and we also aimed at the code size, so it does work in browsers that don't support attachEvent/addEventListener. The function also guaranties that the event object has the most requested methods/properties: "preventDefault()", "stopPropagation()", "target" and "key" (the last one behaves like the "keyCode" on IE). We tested and didn't found memory leaks though.

Tested Browsers

IE 4OK. But an exception is raised if we try to add new properties to the event object. We solved this by adding a "try/catch" statement, the counterpart is that there won't be a so-called "standarlized event" on IE 4 (without adding some extra-code). And we also added a work-around to reproduce the "call" method.
IE 5.1OK.
IE 5.5OK.


Carlos R. L. Rodrigues <> and Jonas Raoni Soares Silva <> at