I want to load a default image if an image fails to load. I also want to call getLoadComplete() once the image has loaded. How do I pass the this.getLoadComplete() function into the function called on img.onerror?
Here is the code I've got:
img.onload = this.getLoadComplete();
img.onerror = function(){
img.src = "http://xxxx.com/image.gif";
}
img.src = request.url;