Javascript Ajax call gets data from a table through PHP. It returns data as a Javascript array.
console.log(this.responseText) I get the following[['ID','StudentName','Age'],['1','Student1','25'], ['2','Student2','24'], ['3','Student3','22'], ]
this.responsetext, i get the following"[['ID','StudentName','Age'],['1','Student1','25'], ['2','Student2','24'], ['3','Student3','22'], ]" ( quotes added )
myarray=this.responsetext
...it gets saved as string.
myarray=[['ID','StudentName','Age'],['1','Student1','25'], ['2','Student2','24'], ['3','Student3','22'], ]
...it is properly saved as an array.
I tried to remove the quotes(") by replace method, but it doesnt have any effect.
How to get a Javascript array from PHP and save it in javascript array, in javascript?