It appears that I'm having trouble accessing my object variables, most likely due to a silly mistake on my part. When I console.log my array of objects (pResult), they all look very similar with the first object expanded:
[Object, Object, Object, Object, Object, Object, Object, Object, Object]
0: Object
depTime: "2014-12-04 18:35"
destination: "Norsesund station"
nr: "562"
operator: "Västtrafik"
typText: "Buss"
__proto__: Object
1: Object
2: Object
3: Object
4: Object
5: Object
6: Object
7: Object
8: Object
length: 9
__proto__: Array[0]
I attempted to do the following...
for (var i = 0; i <= pResult.length; i++) {
var html = html + '<tr>';
var html = html + '<td>';
var html = html + pResult[i].depTime;
var html = html + '</td>';
var html = html + '</tr>';
}
... but encountered this error message:
Uncaught TypeError: Cannot read property 'depTime' of undefined