Hi All,
I have a variable set like this:
var myVar = "slide_set1";
I have a working array which I'm pulling data out of. The array name is the same as the above variable. So, when I view the data in slot 0 of my array like this:
alert(slide_set1[0]);
my result is in fact the correct data.
However, without going into lots of explaination, I need to use the variable name (myVar) plus the array slot position together to create a dynamic function name. I've tried this:
this[myVar+"[0]"]();
with no luck... If I alert this:
alert (myVar+"[0]");
The result is literally slide_set1[0] and not the DATA in the POSITION of slide_set1[0]. I need to return the data in that position to use as a funcion name. Any thoughts would be great!
I have a variable set like this:
var myVar = "slide_set1";
I have a working array which I'm pulling data out of. The array name is the same as the above variable. So, when I view the data in slot 0 of my array like this:
alert(slide_set1[0]);
my result is in fact the correct data.
However, without going into lots of explaination, I need to use the variable name (myVar) plus the array slot position together to create a dynamic function name. I've tried this:
this[myVar+"[0]"]();
with no luck... If I alert this:
alert (myVar+"[0]");
The result is literally slide_set1[0] and not the DATA in the POSITION of slide_set1[0]. I need to return the data in that position to use as a funcion name. Any thoughts would be great!