0

The following code works Chrome, Firefox, Safari but in IE11 returns undefined. I've enabled "Access data across domains" within my IE settings and no longer get a CORS warning in the IE dev console, but instead I get this message. SCRIPT5007: Unable to get property 'dateTime' of undefined or null reference

var i = 0;
var items = [];
var url = "https://www.googleapis.com/calendar/v3/calendars/h5d9i9jrdp2kiljks9erv1q3ec%40group.calendar.google.com/events?orderBy=startTime&singleEvents=true&maxResults=5&alt=json&key=<removed>";

$.getJSON(url, function (data) {
    for (i in data['items']) {
        item = data['items'][i];
        $("#event-list").append(item.summary + "<br/>");
    }
});

http://jsfiddle.net/q0e4kz53/6/

ScottEH
  • 37
  • 1
  • 9
  • have you seen this -> http://stackoverflow.com/questions/5787245/ie9-javascript-error-script5007-unable-to-get-value-of-the-property-ui-obje – davidkonrad Nov 06 '15 at 13:43

1 Answers1

0

IE is apparently more particular about declarations. Once I added the following lines, specifically the declarations for item and items everything worked in IE.

    var i = 0;
    var items = [];
    var item = [];
ScottEH
  • 37
  • 1
  • 9