in jQuery

Use .on instead of .bind, .live and .delegate

Since jQuery 1.7 the .on handler should be used instead of .bind, .live and .delegate as it

“unifies all the ways of attaching events to a document in jQuery — and they’re shorter to type!”
jQuery Blog

.live has been deprecated so it is not even available. .bind and .delegate are still available and some people still prefer there specificity.

See Alfa Jango’s Blog for further explanation.

Write a Comment

Comment