Fires immediately after the client loads the object.
void onload( IHTMLEventObj *pEvtObj );
No return value.
The DISPID for this event is defined in mshtmdid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.
Bubbles No Cancels No To invoke Open a document to invoke this event for the document or any object within it. Default action Loads the object for which the event is specified.
Event Object Properties
The IHTMLEventObj interface contains additional information about the current event. When the onload event is fired, you can use the IHTMLWindow2::event property to retrieve an IHTMLEventObj interface. To obtain an alternate interface pointer such as IHTMLEventObj2 or IHTMLEventObj3, call QueryInterface on the object.
Refer to the specific event object for additional event properties.
The client loads applications, embedded objects, and images as soon as it encounters the applet, embed, and img objects during parsing. Consequently, the HTMLElementEvents4::onload event for these objects occurs before the client parses any subsequent objects. To ensure that an event handler receives the HTMLElementEvents4::onload event for these objects, place the script object that defines the event handler before the object and use the HTMLElementEvents4::onload attribute in the object to set the handler.
The HTMLElementEvents4::onload attribute of the body object sets an HTMLElementEvents4::onload event handler for the window. This technique of calling the window HTMLElementEvents4::onload event through the body object is overridden by any other means of invoking the window HTMLElementEvents4::onload event, provided the handlers are in the same script language.