tdata = new Array();
tdata['id'] = "helloid";
tdata['name'] = "helloname";
tdata['location'] = "hellolocation";
tdata['about'] = "helloabout";
tdata['company'] = "hellocompany";
tdata['website'] = "hellowebsite";
$.ajax({
url: 'export.setsession.php',
data: { tdata: tdata.id
},
type: 'post',
success: function (output) {
//$(location).attr('href', 'index.php');
alert("girdsposted");
}
});
以上工作正常,但如果可能的话,我想将数组作为一个整体传递,例如 data: { tdata: tdata } 而不是仅传递 id。这是可能的还是有替代方案?我还不能将整个数组放入 PHP 中,这是我可以阅读的某种形式......
提前致谢...