help with design - reload image on image load; avoid infinite loop



Hello! I have a page with a graph image that's dynamically generated.
It takes a while for the php script to compile the data and spit out
the graph, so what I want to do is have an ajax "loading" image as the
default image, and then call an xml http request to change the source
to the graph image.

However, I was using the onLoad() event for the image, and of course,
once my graph loaded, it would call the onLoad() event again, reload
the graph, and so on.

I could implement a check not to reload the graph once the source
image had change from the "loading" image, but there's still an
infinite loop of image checking going on, even if the page doesn't
appear to change.

I looked and w3schools says that the onLoad() event only works with
the tags <body>, <frame>, <frameset>, <iframe>, <img>, and <link> .
I'm loading this image inside of a div, my testing with the body tag
doesn't seem to work. Obviously I can't use img. I don't think I want
to use frames ( unless someone gives me a good explanation as to why I
might )

How should I design the site to get this functionality?
.



Relevant Pages

  • Re: help with design - reload image on image load; avoid infinite loop
    ... so what I want to do is have an ajax "loading" image as the ... to the graph image. ... However, I was using the onLoad() event for the image, and of course, ... I could implement a check not to reload the graph once the source ...
    (comp.lang.javascript)
  • Re: help with design - reload image on image load; avoid infinite loop
    ... to the graph image. ... once my graph loaded, it would call the onLoad() event again, reload ... how that could reload once more from the moment the call succeded? ... If it's on the img tag itself, and I it loads an image, then once the ...
    (comp.lang.javascript)
  • Re: help with design - reload image on image load; avoid infinite loop
    ... to the graph image. ... However, I was using the onLoad() event for the image, and of course, ... If you have an 'onload' in the body that calls an xmlhttprequest for an image, how that could reload once more from the moment the call succeded? ... Do you really need an Ajax call to replace an image? ...
    (comp.lang.javascript)
  • Re: Preventing a crash
    ... Is it a Filter-Plugin? ... And how do you bind it currently - ... do you create the graph yourself or are you loading it ...
    (microsoft.public.vb.general.discussion)
  • Re: 2D vector graphics, approach to take.
    ... -the page to be supported by all browsers without requiring any ... This leads me to thinking using some php library which supports making ... graph produced and refreshed which shows the current processing taking ... Your option of creating the image and then loading it into the browser ...
    (comp.lang.php)

Loading