Availability: |
| ||||||
Property/method value type: | Boolean primitive | ||||||
JavaScript syntax: | - | myObject.onload = aHandler | |||||
HTML syntax: | <BODY onLoad="aHandler"> <BODY onUnload="aHandler"> <FRAMESET onLoad="aHandler"> <FRAMESET onUnload="aHandler"> <HTMLTag onUnload="aHandler"> <IMG onUnload="aHandler"> | ||||||
Argument list: | aHandler | A reference to a function object to handle the event |
This event is associated with <BODY> and <FRAMESET> tags. It is triggered when either has finished loading.
In the case of a <BODY> tag, that is when all images are loaded and any <APPLET> or plugin items have started running.
In the case of the <FRAMESET> tag, it is when all frames have loaded and arguably should be after all <BODY> tags have triggered their onLoad events. However, you probably should not rely on the last <BODY> onLoad event occurring before the <FRAMESET> onLoad event.
In any case, it would probably be bad form to have too many onLoad handlers activated during a page load.
Although it is associated with <BODY> and <FRAMESET>, the event is owned by the window object in the Document Object Model.
This fails to trigger on images when they are loaded into version 4.0 of MSIE. If you need an onLoad trigger for the page then you can trigger from the <BODY onLoad="..."> HTML tag attribute. At least when the whole page is loaded your image should have loaded. However, even that isn't always reliable.
Prev | Home | Next |
onKeyUp | Up | onLoseCapture |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |