Op mijn website vang ik af als een plaatje niet bestaat via onerror. Dit doet in Internet Explorer raar. als ik dit via een attribuut instel werkt het altijd, en via image.onerror werkt het alleen op de eerste paar plaatjes. Ik snap niet waarom daar een beperking in aantal zit. Iemand een goed idee?
code:
1
2
3
4
5
6
7
8
9
| image.setAttribute("onerror","this.src = 'images/website/no-image-available-th.png';this.style.width = '50px';this.style.height = '50px';");
//TODO: find out why the method below isn't working in IE, at least not after the first few images (timing issue?)
/*
image.onerror = function () {
this.src = 'images/website/no-image-available-th.png';
this.style.width = "80px";
this.style.height = "80px";
};
*/ |
Rekeningrijden is onvermijdelijk, uitstel is struisvogelpolitiek.