If you reuse this to bind a different list of handlers for different elements, I would create a factory.
function multiFunction(){ var methods = Array.prototype.slice.call(arguments, 0); return function(e){ for (var f=0, l = methods.length; f<l; f++) { methods[f].apply(this, arguments); } } }
and call it as follows
$(document) .on('click', 'someclass', multiFunction( CallbackFunction1, CallbackFunction2)); .on('click', 'someotherclass', multiFunction( CallbackFunction8, CallbackFunction1, CallbackFunction5));
Demo at http://jsfiddle.net/gaby/D8K75/
source share