I have a string variable js_inject and I am looking for a way to call the js_inject() function via the string. Is there any way to do this other than the example below? I am really looking to do this without conditionals.
var myString = 'js_inject';
moderator(stringVar){
if(stringVar == 'js_inject'){
js_inject();
}
}
moderator(myString);
eval(myString)? Where mymyString = 'js_inject()'. It might be simplistic, but that should work.eval