【发布时间】:2018-11-21 03:11:17
【问题描述】:
我正在尝试列出给定演示文稿中的所有幻灯片对象 ID。但是,res.data.slides.objectId 总是以未定义的形式返回。代码:
slides.presentations.get({
presentationId: id,
}, (err, res) => {
if (err) return error(err);
length = res.data.slides.length;
for (a = 0; a <= length; a++){
let ids = res.data.slides.objectId[a];
console.log(ids);
slideObjectIds.push(ids);
console.log(slideObjectIds);
}
});
我尝试过使用JSON.parse(res.data.slides.objectId),但这在u 处停止,它可能是undefined。我知道它是 res.data.slides.objectId 因为我从记录 (console.log)res 开始,它在data 下,然后我记录了res.data,依此类推,发现res.data.slides 有效,但res.data.slides.objectId 不起作用。
Here is the response page.
感谢您的帮助!
【问题讨论】:
标签: javascript node.js google-slides-api