开发者

google calendar api - getting undefined for output for gd$where

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 + 
                        " w开发者_JS百科hen: " + 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"
            }], 


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:

gd$where[0].valueString
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜