<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: delegate</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/delegate.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2008-12-23T12:22:16+00:00</updated><author><name>Simon Willison</name></author><entry><title>jQuery: Changeset 5990</title><link href="https://simonwillison.net/2008/Dec/23/live/#atom-tag" rel="alternate"/><published>2008-12-23T12:22:16+00:00</published><updated>2008-12-23T12:22:16+00:00</updated><id>https://simonwillison.net/2008/Dec/23/live/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://dev.jquery.com/changeset/5990"&gt;jQuery: Changeset 5990&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
“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?


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/delegate"&gt;delegate&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/events"&gt;events&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jquery"&gt;jquery&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/livequery"&gt;livequery&lt;/a&gt;&lt;/p&gt;



</summary><category term="delegate"/><category term="events"/><category term="javascript"/><category term="jquery"/><category term="livequery"/></entry></feed>