Hacker News new | past | comments | ask | show | jobs | submit login

jQuery has a nice efficient event delegation mechanism, that lets you listen for events on elements that don't even exist yet, by specifying selector patterns and listening on the root element with a few global event handlers, instead of adding listeners to every leaf element as it's created. It does all the bookkeeping and event handling in one place, so it saves a lot of memory and time. So not only does it work consistently across all browsers, but it also doesn't suck!

https://learn.jquery.com/events/handling-events/#binding-eve...

https://learn.jquery.com/events/event-delegation/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: