Connecting Tech Pros Worldwide Help | Site Map

image onload

  #1  
Old July 18th, 2006, 01:05 AM
quickcur@yahoo.com
Guest
 
Posts: n/a
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

  #2  
Old July 18th, 2006, 01:45 AM
Kevin Darling
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
image.onload in Firefox jon answers 3 July 19th, 2006 11:15 AM
ASP.NET /JavaScript Problem - Image onload John E answers 0 November 17th, 2005 07:41 PM
Problem with Image.onload event firing too early in IE Adam Ratcliffe answers 1 July 23rd, 2005 05:48 PM
Image onload handler - how to access the image object? Roger Shrubber answers 1 July 23rd, 2005 11:24 AM