onload bug in IE (Mac)

by Jim Coffield <coffield(at)cet.edu>

 Date:  Mon, 18 Dec 2000 18:00:33 -0500
 To:  hwg-languages(at)hwg.org
 In-Reply-To:  localhost
  todo: View Thread, Original
I have run across what appears to be a bug in IE (Mac). I have several
pages where I use the onload event handler to run functions, often dealing
with the properties of some of the layers (CSS) on the page. In IE for the
Mac, if I halt the loading of the page early in the process, either by
hitting the stop button of going to another page (I have a menu bar in a
separate frame so it is very easy to click back and forth between two pages
without letting them load completely), I get a javascript error saying that
document.all.mylayer.style is not an object. It seams that the onload event
is being triggered even if the page has not completely loaded.

This is inconsistent with the descriptions I have read for the onload event
and only occurs in IE 4 and 5 on a Mac. I don't have the option of
excluding this browser and this is middle school educational software so
I'm sure the kids clicking more that they should.

The only options I can think of are to check for the existance of each of
the layers in a conditional statement or kill the error message with the
onerror event handler.

The first option is not very appealing since there are quite a few files,
often with multiple function calls and a dozen or more layers involved in
each page. (I need to press a master CD for publication tommorrow)

The second option could be applied to any page with javascript probably
with a batch process. Since the javascript error is in the 'previous' page
this solution shouldn't hurt anything. I realize this may mask other errors
on the CD but seems reasonable for the production CD.

Do I have any other options?

Thanks

Jim

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA