Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Call javascript function using a javascript string as a parameter
//enable callFunction function
function callFunction(func){
this[func].apply(this, Array.prototype.slice.call(arguments, 2));
}
/* use case, calling many function dynamically
jQuery.each(filterGroups, function(index, value){
if(value.onoff){
if(maybe_debug) console.log(index,':',value);callFishFinderFunction('applyFilter',index);}
});
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment