Hello I'm quite desperate searching for a solution for the following problem.
In my script I make an Ajax GET request which returns JSON data.
It succesfully returns the data, after this I loop it and then my problem occurs.
I have the size of the data among with the main data returned and then I make a loop to append each result to my html code.
resp.size = size of resp
for example resp.sp0 = data item
For each step it should then append to the main html code.
$(".magicproducts").append(resp.sp0.d1);
$(".magicproducts").append(resp.sp1.d1);
$(".magicproducts").append(resp.sp2.d1);
etc..
I tried this in my loop but it does not work, it alerts the correct name but does not work when i use it as a variablename.
var name = "resp.sp"+i;
alert(n