First problem I notice is that you lose the functionality of the passed event control block. Another problem is that you provide no means of communicating with the actual event via a returned true or false value.
I'm curious as to purpose of this code. Couldn't a conditional with addEventListener and attachEvent be used instead of a function for attaching events?
Some people are forever trying to re-invent the wheel.
I wouldn't portray re-inventing the wheel as a bad thing. Just like every programmer has to write their own "hello world" program, every JavaScript developer should get acquainted with DOM before moving onto more abstract libraries.
I wouldn't portray re-inventing the wheel as a bad thing.
I wouldn't -- as long as the re-invention is at least as good as the original. It must have some redeeming quality which makes it valuable over the original.
Bookmarks