The best workaround (I think) you can do is restructure your class to return functions that will make your wishes. This is an example of what I mean:
var MyClass = function(){ return { Set: function(a, b, c){ return [a, b, c].toString(); }, Modify: function(a){ return a + ' .)'; } } }; $(function(){ var mc = new MyClass(); $('.a').on('click', function(){ alert( mc.Modify($(this).data('variant')) ); }); $('.b').on('click', function(){ alert( mc.Modify($(this).data('variant')) ); }); });
So this way you instantiate your class once. Check jsFiddle
source share