I have a funcion whose name is stored in a variable , How can I invoke it?
var fun_name='foo'
Check this out. How to execute a JavaScript function when I have its name as a string
Or simply use a switch like follows:
switch(fun_name){
case "foo":
foo();
break;
case "foo2":
foo2();
break;
default:
fooDefault();
}