0

Note: I have already gone through stackoverflow similar questions but without any luck.

I have following json response received in ajax. I am trying to loop through it but still no success.

[
{"id":"1","type":"size","value":"large","datetime":"2020-10-20 13:45:49"},
{"id":"14","type":"color","value":"red","datetime":"2020-10-20 13:45:49"}
]

I tried many ways including following code but could not get desired result.

for( let prop in responce ){
console.log( responce[prop].id );
}


for( let prop in responce ){
console.log( responce[prop] );
}

Kindly advise how to resolve it?

13
  • yeah, because its response not responce Commented Nov 11, 2020 at 19:58
  • Already tried, no its not working Commented Nov 11, 2020 at 20:00
  • I am fetching data from MySql & return the result using PHP json_encode(). I have already posted result of console.log(responce); Commented Nov 11, 2020 at 20:05
  • 1
    What is typeof responce? You might have forgotten to parse it with JSON.parse. Commented Nov 11, 2020 at 20:09
  • 1
    stackoverflow.com/questions/11922383/… Commented Nov 11, 2020 at 20:16

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.