Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

onload event

Fires immediately after the client loads the object.

HTML 4.01 Specification, Section 18.2.3

Syntax

HTML Attribute <element onload = "handler(event)">
Event Property object.onload = handler;
attachEvent Method object.attachEvent("onload", handler)
addEventListener Method object.addEventListener("load", handler, useCapture)

Event information

SynchronousNo
BubblesNo
CancelableNo

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

Remarks

The client loads applications, embedded objects, and images as soon as it encounters the applet, embed, and img objects during parsing. Consequently, the HTMLLinkElementEvents2::onload event for these objects occurs before the client parses any subsequent objects. To ensure that an event handler receives the HTMLLinkElementEvents2::onload event for these objects, place the script object that defines the event handler before the object and use the HTMLLinkElementEvents2::onload attribute in the object to set the handler.

The HTMLLinkElementEvents2::onload attribute of the body object sets an HTMLLinkElementEvents2::onload event handler for the window. This technique of calling the window HTMLLinkElementEvents2::onload event through the body object is overridden by any other means of invoking the window HTMLLinkElementEvents2::onload event, provided the handlers are in the same script language.

Loads the object for which the event is specified.

To invoke this event, do one of the following:

  • Open a document to invoke this event for the document or any object within it.

The pEvtObj parameter is required for the following interfaces:

See also

Reference
HTMLLinkElementEvents2::onreadystatechange
HTMLWindowEvents::onunload

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.