谷歌日历 api - gd$where 的输出未定义
我能够解析并显示我的所有代码片段的数据,除了这一行中
" where: " + e.gd$where.valueString + // < this line is displaying undefined
正在执行处理的代码块。其他所有内容都显示正确的数据
Titanium.API.info(cal.feed.entry.length);
var i;
for (i=0; i < cal.feed.entry.length; i++){
var e = cal.feed.entry[i];
Titanium.API.info("title: " + e.title.$t +
" content " + e.content.$t +
" when: " + e.gd$when[0].startTime + " - " + e.gd$when[0].endTime +
" evenstatus" + e.gd$eventStatus.value +
" where: " + e.gd$where.valueString + // < this line is displaying undefined
" gcal$uid: " + e.gCal$uid.value
);
,这里是日历中应该显示的内容
"gd$where": [{
"valueString": "Any of the 11 elementary schools"
}],
i'm able to parse in and display data for all pieces of my code except in this line
" where: " + e.gd$where.valueString + // < this line is displaying undefined
here is the code block that is doing the processing. everything else displays correct data
Titanium.API.info(cal.feed.entry.length);
var i;
for (i=0; i < cal.feed.entry.length; i++){
var e = cal.feed.entry[i];
Titanium.API.info("title: " + e.title.$t +
" content " + e.content.$t +
" when: " + e.gd$when[0].startTime + " - " + e.gd$when[0].endTime +
" evenstatus" + e.gd$eventStatus.value +
" where: " + e.gd$where.valueString + // < this line is displaying undefined
" gcal$uid: " + e.gCal$uid.value
);
here is what should be displayed from the calendar
"gd$where": [{
"valueString": "Any of the 11 elementary schools"
}],
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
gd$where 是一个对象数组。为了访问第一个键中的“valueString”,您需要从该对象内部访问它,如下所示:
gd$where is an array of objects. In order to access "valueString" in the first key, you need to access it from within that object, like so: