I found that sometimes I connect 2 functions to buttun using .click (function () {}), is it possible to delete the previous attached function before I connect a new one?
Do not use an anonymous delegate. However, you can .unbind a named function.
UPDATE
In fact, you can call .unbind () with no arguments to remove all handlers, or .unbind ('click') to remove all handlers for a specific event.
jQuery has unbind ()
There are two ways:
function foo(){ //do stuff } function bar(){ //do more } jQ.click(foo).click(bar); jQ.unbind(foo);
or
jQ.bind('click.foo', function(){ //do stuff }); jQ.click(function(){ //do more }); jQ.unbind('.foo');
Source: https://habr.com/ru/post/1335502/More articles:Trying to understand strtok - c ++C ++: FPS displacement calculation - c ++jQueryUI - Resize dialog after loading AJAX - jqueryChar array to char or char array to char? - cIs it better to run 100 SQL queries with a WHERE clause with one condition or one query with a WHERE clause that has 100 conditions? - performanceWhy is my django database database so slow and often not working? - databaseTime Function Syntax - c ++JQuery resizable () dynamic maxWidth parameter - javascriptIs it possible to simulate TMenuBreak functionality using Dev Express TdxBarSubItems? - delphiRegular Expressions / Learning Resources - regexAll Articles