I am facing an issue with a Javascript object that has been parsed from a JSON result. Despite having all the properties defined, I am getting 'undefined' for each of them.
Here is the code snippet:
var yelpObj = JSON.parse(result);
console.log(yelpObj);
document.getElementById('yelp-rating').src=yelpObj.rating_img_url;
Upon checking my log:
{
"is_claimed": false,
"rating": 3.5,
"mobile_url": "http://m.yelp.com/biz/o-griffs-grill-and-brewhouse-quincy",
"rating_img_url": "http://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png",
"review_count": 12,
"name": "O'Griff's Grill and Brewhouse",
...
Despite this, the src attribute remains "undefined". Can anyone help me identify what the issue might be? I have also attempted accessing the property using array notation without success.