There is a FileManager constructor, the setEventStatuses method is removed and the "change" event is set.
The problem is that when you call the setEventStatuses method again , the previous event on the inputs is not deleted and two "change" events are already hanging.
How can I delete the previous event? The problem, of course, is solved if you delete .bind (this) when hanging the event, but still I would like to save the this context in the changeStatus function.
Thank.
var FileManager = function () {}; FileManager.prototype.setEventStatuses = function () { var $el = $('#el'); // // ... // $el.off('change', 'input', this.changeStatus.bind(this)).on('change', 'input', this.changeStatus.bind(this)); }; FileManager.prototype.changeStatus = function (e) { // ... };
changehandlers on this input? - Grundy