for example in this code:
[CODE=javascript]var funcName = "myFunc";
if (typeof eval(funcName) == 'function') {
evail(funcName + "()"); // this will call myFunc
}[/CODE]
but its returns runtime error: myFunc does not exist
what im trying to do is call the function specified in the funcName variable (which is myFunc).
I can call is using
[CODE=javascript]eval(funcName)[/CODE]
but i want to check if it exists before i call it
[CODE=javascript]var funcName = "myFunc";
if (typeof eval(funcName) == 'function') {
evail(funcName + "()"); // this will call myFunc
}[/CODE]
but its returns runtime error: myFunc does not exist
what im trying to do is call the function specified in the funcName variable (which is myFunc).
I can call is using
[CODE=javascript]eval(funcName)[/CODE]
but i want to check if it exists before i call it
Comment