How could i parse this type of json data, getting in "results" to fetch single values like zipcode, state etc
{
"row": [
{
"id": "5",
"name": "test",
"email": "[email protected]",
"street": "mystreet",
"city": "mycity",
"state": "mystate",
"zipcode": "123456",
"myimage": "image.gif"}
]
}
first, you need to parse that string with JSON.parse
var myJson = JSON.parse(the_raw_data_string);
it ends up into an object like this:
var myJson = {
"row": [
{
"id": "5",
"name": "test",
"email": "[email protected]",
"street": "mystreet",
"city": "mycity",
"state": "mystate",
"zipcode": "123456",
"myimage": "image.gif"}
]
}
accessing the items:
myJson.row[0].id
myJson.row[0].name
myJson.row[0].street
//and so on...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With