实体类多层嵌套 遍历_两个for循环遍历多层嵌套的json数据时,只执行一层for循环,求解?...

这是 json 数据

[

{

"content":"ffffffff ",

"doctorAddress":"img/1.png",

"doctorId":1,

"doctorName":"杨小松",

"img":[

{

"headId":1,

"imgAddress":"img/1.jpg",

"imgAddressId":1

},

{

"headId":1,

"imgAddress":"img/2.jpg",

"imgAddressId":2

}

],

},

{

"content":"ffffffff",

"doctorAddress":"img/1.png",

"doctorId":1,

"doctorName":"杨小松",

"img":[

{

"headId":7,

"imgAddress":"img/2.jpg",

"imgAddressId":4

}

],

}

]

ajax后 用for循环拼接

var MainCortent='';

var MainCortentImg='';

for (var i=0;i

MainCortent+='' +

'

'+data[i].content+'

' +

'

'+data[i].doctorName+'

'+data[i].content+'

'+
' +

'

';

你可能感兴趣的:(实体类多层嵌套,遍历)