Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

The Difference Between jQuery's Live() and Delegate() Methods

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
6,117
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 13, 2010

Refer here for the full tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-the-difference-be...

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.

Well examine the specific differences between the two methods in todays video quick tip. Thanks to the FireQuery Firebug extension, well have the tools to more easily understand how each method functions.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Very helpful, thanks!

  • This is so complex..I have a question. Why is it that jquery doesn't recognize my already existing element after an ajax request.

    Say I have an element call console, which i hid before the ajax request and now i want to show it again after the ajax request, even with the live method I can't seem to get around it..anyway, thanks for the tut

  • this jQ is cool thing...

    Nice video

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more