[thelist] onload event in IE Win
Tim Plumb
tim at freewayactions.com
Fri Oct 7 09:10:28 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.
In reality IE is firing these onload events continuously which causes
the application to simply bail out and die. I can recode the page to
use a function to do this when the page loads attached to another
onload event (this time on the body) but I'm curious why IE is
constantly firing these onload events when the page loads.
Looking at the JavaScript spec for the browser it appears IE should
support the onload event on the image.
Any pointers on this are most welcome. I can also place a sample of
the page online but, to be honest, the code is far from clean at the
moment and needs a good tidy up! ;-)
Many thanks in advance,
Tim.
More information about the thelist
mailing list