Image Question

Discussion in 'Javascript' started by Greg Griffiths, Feb 23, 2004.

  1. 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 ?
    Greg Griffiths, Feb 23, 2004
    #1
    1. Advertising

  2. Greg Griffiths

    Mick White Guest

    Greg Griffiths wrote:

    > 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
    Mick White, Feb 23, 2004
    #2
    1. Advertising

  3. "Andrew Urquhart" <reply_via_contact_page@website_in.sig> writes:

    > 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
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Feb 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry J
    Replies:
    0
    Views:
    542
    Jerry J
    Jul 18, 2003
  2. Mike John
    Replies:
    0
    Views:
    506
    Mike John
    Jul 28, 2003
  3. Gary B

    Image can't hold an image?

    Gary B, Jul 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    344
    Steve C. Orr, MCSD
    Aug 1, 2003
  4. Jim Hammond
    Replies:
    1
    Views:
    486
    Oliver
    Nov 13, 2003
  5. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,287
    Kartic
    Jan 26, 2005
Loading...

Share This Page