我有以下对象,我需要将其转换为 ajax 帖子的数组。有谁知道如何在 javascript/jquery 中执行此操作?
[Object, Object, Object, Object]
0: Object
name: "authenticity_token"
value: "d8792991d3941352c00474e3f6b4081bd1d7e818"
1: Object
name: "_method"
value: "POST"
2: Object
name: "email"
value: "sdaasdsa"
3: Object
name: "password"
value: "asddadsadasdsa"
这是我的 jquery 帖子,我需要将对象作为字段数组:
jQuery.post(formAction, fields).done(function(response) {
console.log(response);
}, "json");
谢谢皮特