[thelist] onload event in IE Win

Christian Heilmann codepo8 at gmail.com
Fri Oct 7 09:22:01 CDT 2005


> Hi all,
> I've an HTML gallery that I'm putting together on the Mac in BBEdit
> and I'm glad to say that it works flawlessly in both Safari, IE and
> other Mac browsers. On checking a test page in IE 6 on a Windows XP
> machine the browser beeps twice and kills the application. Not
> ideal! ;-)
> I tracked down the problem to an of onload event attached to each of
> the thumbnail images in the page. What should happen is that when
> each of these images completes loading it fires a function that looks
> for a cookie of the same name. If found another image next to the
> thumbnail is swapped for a 'flag' graphic.

MSIE only fires the onload event when the image is not cached. Once it
is cached it does not fire the event any longer. Therefore you need to
either change the filename by adding a random value - and effectively
not allowing caching, or you need to store the state of the loaded
image somewhere else. I started storing an "hasloaded" boolean as an
object attribute instead.

Firefox does not like the random value hack on local files either, so
it is all a big mess.

What exactly are you trying to do?

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/


More information about the thelist mailing list