In Jquery i\'d like to disable any plugin I want by changing a variable name. However the following code doesnt work
function disablePlugin(functionName) {
To invoke the function passed in as a string, you could do
function disablePlugin(functionName) {
$('#divID')[functionName]('disable')
}
disablePlugin('sortable');
This is how you would do that:
function disablePlugin(functionName) {
$('#divID')[functionName]('disable')
}
disablePlugin('sortable');
This works because someObject.foo
is the same thing as someObject['foo']