I have this code:
$.post("call.php", {form: data.item.value, positiony: t}, function (data){ top[t] = data;});
$("#pos" + t).css("margin-top", top[t] );
where I call a page with function post of ajax and the returned value is used to set margin-top of a series of div with increment id #pos0, #pos1...; if I change t with number, n times, where n is the number of divs, I have no problem; but if I use 'for' to increment the value, I have undefined variable t in the lambda function; in fact if I print top[t] after lambda function, the value printed is undefined. How can I resolve?