JSの複雑な対象の伝達とつなぎ合わせ
1354 ワード
Document
$(function(){
var formData = [];
var bonImport = {};
bonImport['name'] = 'tom';
bonImport['id'] = 1;
bonImport['score'] = 89;
bonImport.fxList = [];
bonImport.fxList.push({filename:'1.txt',mongoid:'23424serfrwrdsf'});
bonImport.fxList.push({filename:'2.png',mongoid:'3442sfgbbbetebb'});
bonImport.ylList = [];
bonImport.ylList.push({filename:'243.txt',mongoid:'4234234234g5235'});
bonImport.ylList.push({filename:'kk.png',mongoid:'34424r2423betebb'});
console.log(bonImport);
var bonImport2 = {};
bonImport2.name = 'jack';
bonImport2.id = 22;
bonImport2.score = 100;
bonImport2.fxList = [];
bonImport2.fxList.push({filename:'1.txt',mongoid:'23424serfrwrdsf'});
bonImport2.fxList.push({filename:'2.png',mongoid:'3442sfgbbbetebb'});
bonImport2.ylList = [];
bonImport2.ylList.push({filename:'243.txt',mongoid:'4234234234g5235'});
bonImport2.ylList.push({filename:'kk.png',mongoid:'34424r2423betebb'});
console.log(bonImport2);
formData.push(bonImport,bonImport2);
//console.log(formData);
var tt = JSON.stringify({listb:formData});
//console.log(tt);
//console.log({formData:tt});
})