How do I get each value of a jquery object? [closed]

0

My result array:

 {
   "status": "accept",
   "info": "",
   "message": {
     "row": {
       "1": {
         "id": "1677",
         "state": "AC",
         "stateid": null,
         "address": "RUA   MARIA LUCIOLA DA SILVA",
         "addressinfo": null,
         "cityid": null,
         "neighborhoodid": null,
         "city": "RIO BRANCO",
         "neighborhood": " VILA DA AMIZADE",
         "addressnumber": null
       }
     },
     "rows": []
   }
 }

I want to get for example: id: 1677

    
asked by anonymous 18.07.2016 / 23:09

1 answer

1

The structure is similar to the PHP array:

var result = {
       "status": "accept",
       "info": "",
       "message": {
         "row": {
           "1": {
             "id": "1677",
             "state": "AC",
             "stateid": null,
             "address": "RUA   MARIA LUCIOLA DA SILVA",
             "addressinfo": null,
             "cityid": null,
             "neighborhoodid": null,
             "city": "RIO BRANCO",
             "neighborhood": " VILA DA AMIZADE",
             "addressnumber": null
           }
         },
         "rows": []
       }
     }

To get the id of: message - > row - > 1: result.message.row[1].id or result['message']['row'][1]['id']

To get status: result.status
To get info: result.info
To get rows: result.message.rows

    
19.07.2016 / 14:45