Hi,
I’m trying to add a prototype method to the Image object, but I always get the error “images[i].getSize() is not a function”. Why?
Here is the relevant code:
Image.prototype.getSize = function() {
...
};
function getImages(obj) {
var jsonData = obj.data;
...
images = new Array();
for (var i = 0; i < jsonData.images.length; i++) {
images[i] = new Image();
images[i].src = jsonData.images[i].url;
images[i].getSize();
}
}
Thx.