Currently I have an ajax setup where my page with javascript calls a php file which then returns data via xhttp.responseText. This works great for strings but when I pass it a json encoded array, it still views that results as text. I get a string formatted version of my array that looks like this [1,2,3,4,5,6,7]
Which sort of works, but it's inconvenient because it's text representing an array and not an actual array.
How can I receive the data as an array instead of an array in text format? Currently I can still get the data using split(), but that seems sloppy. Is there an alternative to xhttp.responseText that would work better?