Quick Tip: The Difference Between Live() and Delegate()


This Cyber Monday Envato Tuts+ courses will be reduced to just $3. Don't miss out.

In jQuery 1.3, the team introduced the live() method, which allows us to bind event handlers to elements on the page, as well as any that might be created in the future dynamically. Though not perfect, it definitely proved to be helpful. Most notably, live() bubbles all the way up, and attaches the handler to the document. It also ceases to work well when chaining method calls, unfortunately. Delegate() was introduced in version 1.4, which almost does the same thing, but more efficiently.

We'll examine the specific differences between the two methods in today's video quick tip. Thanks to the FireQuery Firebug extension, we'll have the tools to more easily understand how each method functions.

Alternate Viewing Options


This can definitely be a confusing topic. Please feel free to ask questions, or discuss within the comments. Thanks so much to Elijah Manor for clarifying a few things for me on this topic!