function addMethod(object, name, fn) { var old = object[name]; object[name] = function() { if( fn.length == arguments.length ) { return fn.apply(this, arguments); } else if { return old.apply(this, arguments); } } } // object - object to be acted on // name - name of the function, i presume // fn - callback function, i presume
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)