I’ve just been pondering the jQuery live() event binder, which seems like a really useful function.
http://docs.jquery.com/Events/live
One thing I note is that it doesn’t support all events:
“Currently not supported: blur, focus,
mouseenter, mouseleave, change, submit”
My (very simple) mind reasons that surely if it were implemented for one event, it would be easy to do it for all others?
Clearly its wasn’t that simple, so I wondered if anyone knows why it was so difficult to do it for all others?
This is because it uses event delegation. The problem is that event delegation based on event bubbling. And events are bubbling not for all events.
you can read more here: JavaScript Event Delegation is Easier than You Think