Image Question

G

Greg Griffiths

Is there a Javascript way to check if an image has been rendered on the
page ? For example if my HTML includes :

<img name="testImg" src="images/one.gif">

is there anyway to tell using Javascript post page load if that image
has actually been loaded ?
 
M

Mick White

Greg said:
Is there a Javascript way to check if an image has been rendered on the
page ? For example if my HTML includes :

<img name="testImg" src="images/one.gif">

is there anyway to tell using Javascript post page load if that image
has actually been loaded ?

<img onload="function(){whatever}"
Mick
 
L

Lasse Reichstein Nielsen

Andrew Urquhart said:
Just a general note:
Some browsers don't support the onload event for images (i.e. Opera)

Opera does support the onload event. There was a bug somewhere around
7.11 (or was it 7.20) where it failed, but in general it works (and did
in Opera 6 as well).
so be sure to provide a graceful and accessible alternative if
possible.
/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top