I know the difference between delegate () and on () , but I have doubts that on () is very popular and faster than delegate () , which is why jquery does not remove delegate()from its library.
delegate()
live () has flaws and then removed from jQuery-1.9 version. Also, if we see performance between on () and delegate () , then it on()runs much faster than delegate().
jQuery-1.9 version
on()
Then any reason to save delegate () in jQuery?
This is what the jQuery team member wrote regarding this issue in 2013:
" .bind .delegate, , ., ..live, , .
" .bind .delegate, , .
.bind
.delegate
, .
.live, , .
.live
, delegate() on(), delegate() - , ( ).
:
jQuery 1.7,.delegate() .on().
. .
, , , ... . ...
.on() not.delegate
onDesigned for replacement delegate. Probably, jQuery authors could take some time to make it more backward compatible. Many old plugins still use these methods. probably this may be the reason for its conservation.
on
delegate
You can bind and delegate events using the method on(). Just the syntax is different.
Just follow this link:
http://learn.jquery.com/events/handling-events/
They perfectly explained with examples.
Source: https://habr.com/ru/post/1535309/More articles:How can I make an itemgetter to enter input from a list variable? - pythonSystem.out messes up after serializing Jackson - javaTinyMCE IndexSizeError in IE9, IE10 - javascriptAngular js ng-change event - javascriptПочему Angular.js часто вызывает мою функцию с ng-change и как заставить его вызывать только один раз за изменение? - javascriptVertical alignment with Pure CSS (from YUI) - cssSupport for ActionBar and GameBaseActivity - androidhow to call a class of a class as a parameter in java - javaPrevent Listview links from being intercepted using its Child MapView - androidСлабые требования: как убедиться, что объект инициализирован - javaAll Articles