![]() |
|
#1
|
|||
|
|||
|
Is there any way to check if the image refered by the img tag was successfully loaded?
Thanx, Daniel Campelo Daniel Campelo |
|
#2
|
|||
|
|||
|
Yep,
you can use onImgError or something like that, and run a little javascript function to replace the broken image with a default one. I've used it on the front page of a site i've worked on freefivers.com so look at the code on there. Let me know if you need any help intergrating it. Tom [url=http://www.webchalkboard.com]usable by design[/url:0wn9bga5zy] |
|
#3
|
|||
|
|||
|
Thanx Tom. It's the onerror event.
Here's a code example.:mrgreen: [code:w5dcbwmmsg] <img (...) onError="alert('Image failed to load.')"/> [/code:w5dcbwmmsg] Though there is a small problem, in some versions of the firefox this event won't start.:x Have anyone created an alternative script to check if the image took to much time to load and as a consequence target it as fail. Daniel Campelo |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|