I have multiple tables(with same structure)in my html. They are in tabs. I am creating tabs dynamically and i want to send those table data to the mysql database. So i wanted to get those data using javascript. I am correctly created TableData1,TableData2.... arrays using for loop. Problem is I cannot increment TableData here ('TableData'+i).shift(); . I am getting an error. I want to create TableData1.shift(),TableData2.shift().....
function myDataSendFunction(){
var i;
for(i = 1; i <= array_size; i++){
eval(var TableData+i+=[];);
$('#mytable'+i+ ' tr').each(function(row, tr){
('TableData'+i)[row]={
colum1 : $(tr).find('td:eq(1)').text()
, colum2 :$(tr).find('td:eq(2)').text()
, colum3 : $(tr).find('td:eq(3)').text()
, colum4 : $(tr).find('td:eq(4)').text()
, colum5 : $(tr).find('td:eq(5)').text()
, colum6 : $(tr).find('td:eq(6)').text()
, colum7 : $(tr).find('td:eq(7)').text()
, colum8 : $(tr).find('td:eq(8)').text()
}
});
('TableData'+i).shift();
}
}
I am getting this error.
Uncaught TypeError: (TableData + i).shift is not a function
at myDataSendFunction (<anonymous>:25:25)
at HTMLInputElement.onclick (create.php:1)