2016-11-02 2 views
0

메시지를 내 msges 필드에 저장하고 있습니다. 이것은 내가 아약스라는 형식개체 배열을 키 쌍 값으로 변환하는 방법

enter image description here

이며이 형식으로 나에게 데이터를 반환

[개체, 개체, 개체]

내가 그것을 변환 할 객체 키와 객체 값이있는 배열로 변환합니다. 어떻게해야합니까?

+1

http://stackoverflow.com/questions/20881213/converting를 사용할 수있는 객체

//result is the result of the query for (var line in result) { //acces to uname by line.uname //acces to email by line.email } 

희망과 같은 값을 읽고 -json-object-into-javascript-array – Armen

+0

다음과 같이 forEach를 사용해보세요. msges.forEach (function (msg) { date : {msg.from, ....} }}); –

+0

좋아요. 시도해주세요. @ JoãoVilaça –

답변

0

당신은 당신에게

도움이 될 것입니다 아니면 for each

//result is the result of the query 
     for each(line in result) { 
     //acces to uname by line.uname 
     //acces to email by line.email 
     }