【发布时间】:2013-06-20 13:43:33
【问题描述】:
我有以下对象,我需要将其转换为 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");
谢谢 皮特
【问题讨论】:
-
看起来你这里有一个对象数组
-
jQuery.makeArray(Obj)
标签: javascript jquery ajax arrays object