Simon Willison’s Weblog

Subscribe

jQuery: Changeset 5990. “Added a new liveQuery/event delegation hybrid method”. Lets you add events that continue to work as new elements are dynamically appended to the DOM, e.g. $(’div p.foo’).live(’click’, fn). Works by adding an event handler to the root document element itself and relying on event bubbling. I have to admit I preferred the earlier proposal of $(’div’).delegate(’p.foo’..), which feels like it should have much better performance—anyone know of a good plugin that supports this?