简体   繁体   中英

JSON object shows in dev tools but unable to access with dot notation

Chrome开发人员工具的屏幕截图

I can't seem to access the JSON object. Tried dot notation. Image is of Chrome dev tools.

console.log(artwork_data.artItems) comes up with undefined when I try to access properties, like artwork_data.artItems.artId .

Any help greatly appreciated. Thanks!

In order to access that object you would need to first access the element within the array for example:

$.each(artwork_data, function (index, value) {
     console.log(value.artId);
});

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM