What are the significant differences among $(sel).bind(“click”, $(sel).click(, $(sel).live(“click”, $(sel).on(“click”?

后端 未结 2 458
难免孤独
难免孤独 2020-11-27 23:37

I\'ve been using them for quite some time, but most of the time, I prefer the shorter one, however, I just want to really dig in to the nitty-gritty details. I may have been

2条回答
  •  余生分开走
    2020-11-28 00:11

    There is no difference in functionality in that particular case. However, .on is preferred over .bind as of jQuery 1.7, and as for .click - it's just a shorthand for a common event handler.

提交回复
热议问题