Page 1 of 1

How to correctly format response in server code?

Posted: Mon Jun 02, 2014 9:04 pm
by adam griffin

My response is this:
[
[
"Post: Chilling watching attack on titan",
"Username: ajpsp5",
"Post: Whats up peeps!",
"Username: ajpsp5",
"Post: chocolate women with big lips <<
]
]


How to correctly format response in server code?

Posted: Mon Jun 02, 2014 9:06 pm
by adam griffin

I would like to format it so I can map "Post" and "Username" to labels


How to correctly format response in server code?

Posted: Mon Jun 02, 2014 9:27 pm
by adam griffin

Never mind found it out.
<!--
var jsonArr = [];
for (var i=0; i<count; i++) .
{

Code: Select all

 jsonArr.push({ 
     Post: XHRResponse.body[i]["Post"], 
     Username: XHRResponse.body[i]["Username"] 
 }); 

}
--


How to correctly format response in server code?

Posted: Mon Jun 02, 2014 9:39 pm
by Alena Prykhodko

Thank you for update.