我正在使用http://jqueryui.com/sortable/ 查看此代码
var tmp_build_form = new Array();
var groups = $('#form_section').sortable('toArray');
var ordering = '';
if ( groups )
{
for ( var i in groups )
{
if ( typeof(groups[i]) != 'function' )
{
ordering += groups[i]+',';
if ( groups[i].indexOf('group') == 0 )
{
var fields = $('#form_section div#'+groups[i]+' div.group_fields_container').sortable('toArray');
tmp_build_form[groups[i]] = Array();
tmp_build_form[groups[i]] = fields;
}
else
{
tmp_build_form[groups[i]] = true;
}
}
}
tmp_build_form['ordering'] = ordering;
}
我正在尝试通过帖子发送tmp_build_form
$.post(save_url,{'data' : tmp_build_form}, function(data) {
alert(data);
});
它发送空数组,但是当console.log
它给我数组时,我该如何解决这个问题
这是 tmp_build_form http://img41.imageshack.us/img41/1240/30252807.jpg的控制台结果