I have this code, where I pass the jsFile name to load and the java script function to call in it. But as the function is still not loaded, so I have to send string names and use this type of switch statements.
$.getScript(jsFile, function() {
switch(initFunc){
case 'a':
a();
break;
case 'b':
b();
break;
};
});
Is there anyway this can be simplified, I don't want conditional statements.