update
My code that works. When the page is loaded
product= [[],[]];
then the code executed after ajax call:
$('#contextreload ul').each(function(i, ul) { product.push([]); }); $('#contextreload ul').each(function(i, ul) { allline=i; $('#reloadajax'+i+' li').each(function(lk, li) { var lilk = $(li).html(); product[i][lk]=lilk;
Use eval (); in ajax answer for this, with some changes in php file? / EndUpdate
product [0] = [1,2,3,4];
product [1] = [a, b, x, g];
.
.
product [10] = [extra, extra, extra, extra];
When I load a page, this is done: product= [[],[],[],[],[],[],[],[],[],[]];
But if I declare this when I call ajax, I can push add data only to this array (10 rows) If I have 11 rows ( product[10][0] and product[10][1] ), extra data will not be added. After calling ajax, I need additional data: product= [[],[],[],[],[],[],[],[],[],[],**[11]**];
This function is related to the fact that I want to put data into an array after loading ajax data from a php file.
$('#contextreload ul').each(function(i, ul) { <strike> var product = $(ul).html(); </strike> allline = i; $('#reloadajax'+i+' li').each(function(lk, li) { var lilk = $(li).html(); product[i][lk]=lilk; alert(lilk+lk);