L
lawpoop
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?
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?