jessevitrone
07-18-2003, 08:33 AM
Is there a way to make a dynamic call to a function that is on a class?
MyClass.prototype.setMainHTML = function() {
var displayFunc = new Function("setMainHTML" + this.attributes["type"] + "()");
displayFunc();
};
this.atributes["type"] == "Text"
I'd like to be able to call the MyClass.setMainHTMLText dynamically. I have a MyClass.setMainHTMLText defined, but I don't know how to make the call so that it's executing for the current object.
I tried making the string inside the Function() method "this.setMainHTML", but that didn't work. Neither did trying to use "this.displayFunc();"
Any suggestions?
MyClass.prototype.setMainHTML = function() {
var displayFunc = new Function("setMainHTML" + this.attributes["type"] + "()");
displayFunc();
};
this.atributes["type"] == "Text"
I'd like to be able to call the MyClass.setMainHTMLText dynamically. I have a MyClass.setMainHTMLText defined, but I don't know how to make the call so that it's executing for the current object.
I tried making the string inside the Function() method "this.setMainHTML", but that didn't work. Neither did trying to use "this.displayFunc();"
Any suggestions?