我能够解析并显示我的所有代码的数据,除了这一行
" 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"
}],
答案 0 :(得分:3)
gd $ where是一个对象数组。要在第一个键中访问“valueString”,您需要从该对象中访问它,如下所示:
gd$where[0].valueString