| Author |
jQuery live() custom events
|
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
With the livequery plugin I can do something like this:
With jQuery's live() function, I have to do this
Am I missing something or do we have to call trigger to force the custom live event? The jQuery demo does this because the live event is triggered by another event. I don't see how this is better than not using live() at all, since a manual trigger is required.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
The two are not the same. In the livequery() example, you are establishing a "match handler" -- one that automatically gets called when a matching element is created. live() has no such facility.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
Bear Bibeault wrote:live() has no such facility.
Ok, thanks Bear.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
A little history. In jQuery 1.2, live() did not exist. The LiveQuery plugin provided two facilities:
Establishing match/mismatch handlers (called when a matching element comes into, or goes out of, being)."Live" events
The latter facility was incorporated into jQuery core as part of its event handling facility. The former was not. I still use the LiveQuery plugin for matching handling.
|
 |
 |
|
|
subject: jQuery live() custom events
|
|
|