How to pass array with ajax?

There is an array of the form:
5c9cadc707a3d746262324.pngI need to pass it via ajax, how to do it?
try this:
$.ajax({
 async: false,
 url: "test.php,
 data: {"data[]":data},
 type: 'post',
 success: function(result){
console.log(result)
}
 });

but in response to seeing what is coming :
5c9cae8bebd15768453846.png
March 19th 20 at 09:00
1 answer
March 19th 20 at 09:02
you need to pass json as json
$.ajax({
 async: false,
 dataType: 'json',
 data: data,
 url: 'test.php',
 type: 'post',
 success: function(result){
console.log(result)
}
})
so I'm not json, but an array
var TableList = new Array(); - olaf.Rutherford commented on March 19th 20 at 09:05
@olaf.Rutherford, I don't know will hurt you or not, the data type of the array object you need to pass json type
or at least sterilizati into a string and pass it as a string.
About types of data transmitted with this method, oddly enough, it is possible to esteem in docks of this method - sandra_Thomps commented on March 19th 20 at 09:08

Find more questions by tags JavaScriptAJAX