When writing jQuery binding events, I typically use the bind(
) aliases (click()
, submit()
, etc).
But, the more I use dynamically generated content, the more I find its ambiguous as to when bind()
won't work, and end up debugging for a half hour until I try live()
and it works.
Within the parameters of ID-selectors (like '#foo
', not .classes
or elements ('input')
):
Are there any drawbacks to just always using live()
instead of bind()
for these types of bindings, besides the lack of convenient aliases, since there can only be one DOM element tied to a particular ID?
===========
EDIT: I'm not asking what the difference between bind()
and live()
are; that's been covered. I'm asking what are the drawbacks of just using live() by default, since the temptation is to do so in instances where you can't mistakenly overselect (ie, when you're using a #uniqueDomElement
), and avoid thinking about when bind()
is not appropriate.