Maybe it's a problem of downloading time : the code is executed before
the
image is completely loaded.
onerror seems to be a more appropriate choice, IMO, because it's up to
the
browser to determine if there's error or not after a timeout.
Moreover,
onerror is standard in DOM2 whereas I can't find any reference of
complete
in DOM1&2 (correct me if I'm wrong) even though complete was
implemented in
JS 1.1.
> -----Message d'origine-----
> De : Louise Greally [mailto:lou_greally@h...]
> Envoy=C3=A9 : mardi 29 octobre 2002 07:23
> =C3=80 : javascript
> Objet : [javascript] Re: SV: Checking if Img src exists
>
>
> yes it works most of the time. sometimes when i first run the code it
> doesnt work until i run it again. i.e. I run the code on the onchange
> event of some fields and sometimes it only works if I change
> the field a
> couple of times first?? although the function is running the
> code just not
> running that bit of code??