Say we have the following jQuery plugins
$.accordion(); $.button();
and in the script we have the following code:
var plg = "accordion"; $('selector').plg(); plg = 'button'; $('selector').plg();
The above example, ofcource does not work. But is there a way to do something like this without using eval ()?
Can I run jQuery plugins from a variable?
source share