Connecting Tech Pros Worldwide Help | Site Map

image onload

quickcur@yahoo.com
Guest
 
Posts: n/a
#1: Jul 18 '06
Hi all,

What happend to the onload event of <img src=myimage.jpgtag if the
myimage.jpg is not available? My feeling is that the onload is not
called at all. How can I capture the event if the link is broken?

Thanks,

qq

Kevin Darling
Guest
 
Posts: n/a
#2: Jul 18 '06

re: image onload



quickcur@yahoo.com wrote:
Quote:
What happend to the onload event of <img src=myimage.jpgtag if the
myimage.jpg is not available? My feeling is that the onload is not
called at all. How can I capture the event if the link is broken?
For IE, set up the onerror property:

<img src="myimg.jpg" onload="doGood()" onerror="doBad()">

Whoa. While testing this, I just found that the onload event fires
each time an animated GIF loops. Never noticed that before. Bug?

Kev

Closed Thread