The live()
method was deprecated in jQuery 1.7. The jQuery docs now recommend
Use .on()
to attach event handlers. Users of older versions of jQuery should use .delegate()
in preference to .live()
.
I understand how on
and delegate
work, but I don't understand why they are better. live()
is simpler and easier to use.
Is there a reason why live
was deprecated? How are the other methods better? Will anything bad happen if I continue to use live
?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…