Here we go again...
I'm playing around with something at the moment, I'm trying to find a way to be able to call pass a function as a paramater to another function, for example:
Code:
var obj = new Object();
obj.test = function() {
alert("working!");
}
obj.run(param) {
param; //execute param, in theory.
}
so that when you call:
obj.run(obj.test);
obj.test gets executed. Obviously it doesn't work. A bit of playing around had led me to believe it is simply putting the code of the function there instead of running it, whether it's a named function of an anonymous function attached to an object. Anyone got any ideas?