前情提要:
简单的说,就是在JS里面定义了了个关联数组
let arNew = {
"reviewID": REVIEWID,
"DeviceName": arAllDevices[index].DeviceName,
"Default": arAllDevices[index].Default,
}
arData_SelectedDevices[arAllDevices[index].OpenID] = arNew;
然后想通过JQ的Ajax传递到后台,PHP接收,然后问题就是:
直接传递,发现传递不了
console.log(arData_SelectedDevices); //这里正常显示关联数组的内容
$.ajax({
type: "post",
url: "./data/Define/DeviceOperation.php",
async: true,
data: {
flag: "保存已选设备",
arData: arData_SelectedDevices //打开控制台,发现这个arData没有传递到后台,PHP文件执行的时候显示arData未定义
},
success: function(data) {
console.log(data);
},
error: function(data) {
console.log</