On 2008-10-23 14:26, Montezuma's Daughter wrote:
my expected results are , alert ('1,2,3)
but the results are alert(undefine)
function ActivateFuncOnObjects(list,Callbackfunction)
{
return function() { Callbackfunction.apply(list); };
You don't need apply() here, just write Callbackfunction(list). If this
is a reduced example, and you do need to use apply() for some reason,
you'll have to call it with the correct arguments. The first argument is
an object to be used as 'this' in Callbackfunction, and the second
argument is an array.
https://developer.mozilla.org/en/Cor...Function/apply
- Conrad