[Koha-bugs] [Bug 11877] Eliminate use of deprecated jQuery .live() method

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 3 18:57:10 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11877

--- Comment #4 from Owen Leonard <oleonard at myacpl.org> ---
> IS there a reason to prefer this way instead of:
>   $("#renewselected_link").on("click", function(){

".click(function(){" is an shortcut for ".on("click",function(){", so most of
the time the two are completely interchangeable.

In this case we need to use ".on()" because we're attaching an event to an
element which has not yet been created. The use of ".on()" quoted above means,
"For all existing and future instances of '#renewselected_link' which are
descendents of "body," attach this click handler."

http://api.jquery.com/on/

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list