Considering the following code:
var SomeObject = function (id) {
this.id = id;
};
SomeObject.prototype.Handler = function() { alert(this.id);};
var o = new SomeObject("bla");
$('#someDivId').on('shown.bs.modal', o.Handler);
I was expecting a popup saying "bla", but I get a popup saying "someDivId".
Is there a way to use an instance method as an event handler ?
I read Class methods as event handlers in JavaScript? and Using an object's method as an event handler, how do I remove it? but I can't transcript them to my case.