I have AJAX
use for loop
to let array values in .
and response will not response my source values, only have final result.
code:
var arrayD = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q"]
for (var i = 1; i < arrayD.length; i++) {
var arrayValus = arrayD[i];
$.ajax({
type: "post",
contentType: "application/json; charset=utf-8",
url: "url.aspx/ABCstringPlus",
data: "{to:'" + arrayValus + "'}",
success: function (msg) {
console.log(arrayValus);
}, Error: function (msg) {
alert('error');
}
})
}
I want to get my source values, but it all only get last array values "Q" ... even my parameter is "A" or "B"...
How do I to get my source parameter?