views:

5

answers:

1

Since ie does not support event capturing, is it a waste of time using w3c event binding techniques?

i'm thinking of just going with the level 1 event binding here - http://dean.edwards.name/weblog/2005/10/add-event/ But I'm having a hard time understanding the need for the hash tabling.

A: 

You'll kill yourself implementing your own event system. Just use jQuery's. It's going to be better than anything you'll come up with unless you spend dedicated years on it.

The reason for hash tables is so the event handlers attached can be referenced easily and removed, and can be tracked down easily as well.

To removeEventListener you have to have a reference to the function. If you fed an anonymous one, you don't have a reference to it. That is why the hash tables map the events to the event handlers internally so you don't have to.

meder

related questions