how to pass array in ajax code example
Example 1: passing data variable using ajax
var myVar = "test";
$.ajax({
url: "test.php",
type: "POST",
data:{"myData":myVar}
}).done(function(data) {
console.log(data);
});
Example 2: how to send js array from ajax
$.ajax({
type: "POST",
url: "submit",
data:JSON.stringify(detailsArr),
success: function(html){
alert( "Submitted");
}
});