jquery ajax 怎么报把数组传到后台
1个回答
展开全部
这里有一例供你参考:
var _list = {};
for (var i = 0; i < checkedRow.length; i++) {
_list["selectedIDs[" + i + "]"] = checkedRow[i].ID;
}
$.ajax({
url: '@Url.Action("SetCallBackStatus")',
//data: { "selectedIDs": _list },
data: _list,
dataType: "json",
type: "POST",
//traditional: true,
success: function (responseJSON) {
// your logic
alert('Ok');
}
});
var _list = {};
for (var i = 0; i < checkedRow.length; i++) {
_list["selectedIDs[" + i + "]"] = checkedRow[i].ID;
}
$.ajax({
url: '@Url.Action("SetCallBackStatus")',
//data: { "selectedIDs": _list },
data: _list,
dataType: "json",
type: "POST",
//traditional: true,
success: function (responseJSON) {
// your logic
alert('Ok');
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询