Wednesday, 14 August 2013

Get dynamically created variable with javascript

Get dynamically created variable with javascript

I have created with php several javascript array which are called as follows:
pricesArray_230 pricesArray_350 ...etc...
I now want to access these arrays, but I have no clue how to include the
dynamic part.
My code right now, which is not working:
newPrice = pricesArray_+productId+[currentSimpleProduct][0];
Where productId is the dynamic part and represents 230, 350, or any other
number.
Do any of you have an idea how to dynamically call these arrays?

No comments:

Post a Comment