I make an AJAX call to fetch some data, get the data back as a JSON Object (not a string).
When I log the object, I get the correct object and it’s properties. However, when I try to log one of the objects properties, I get undefined.
For a screenshot of my code:
https://i.stack.imgur.com/qWiq0.gif
For a screenshot of the console log:
https://i.stack.imgur.com/THp4s.gif
What am I doing wrong?
It looks like your
POSTis returning data in an array, not as an individual object. I bet if you logdata[0].bursary_name, you will see the correct logged output.