I need to be able to call functions in jquery based on a variable - like windowvarname in javascript. This is not a duplicate question because the other answer is for javascript and not jquery.
For example;
var name = 'test1';
function test1() {
alert('test1 called');
}
function test2() {
alert('test2 called');
}
name();
I want to do this so that I can dynamically call functions based on the results from an array.
I've been searching high and slow but I can seem to be able work this out.