data is an array of Json data
The structure of each object is:
var data = [
{
id: 0,
img: "image_src",
width: 107,
height: 80,
shadowBoxLink: "....",
th: {
width: 107,
height: 70,
img: "src"
}
},
{
id: 1,
img: "image_src",
width: 107,
height: 80,
shadowBoxLink: "....",
th: {
width: 107,
height: 80,
img: "src"
}
}
];
When I try to access the array in a loop (only happens in IE8, IE7) with:
for(var i in data) {
var imgHeight = data[i].th.height;
}
I got an error message: "Impossible to get property of "height" the reference is null or not defined"
(I translated the message from french: Impossible d’obtenir la propriété « height » d’une référence null ou non définie)
What am I doing wrong?