I am trying to call a function whose name is defined elsewhere is the code.
Below is sample code:
Inner.testFunc = function(node) {
var functionName = node.substring(node, to.indexOf('@'));
// call the function based on functionName
[functionName + '()']
}
function something() {
//doing something
};
...
Assuming that functionName = something
, this should try to call the function, but it isn't doing it.
I'm tried using other links such as Call javascript function which name is in variable but it didn't help.
I've also tried using eval():
eval(functionName + '()');
but this returned something about an illegal character...