Click to return to the Component Development home page    
createEventObject Method     ondetach Event     HTC Reference    
Web Workshop  |  Component Development

oncontentready Event


Fires when the content of the element, to which the behavior is attached, has been completely parsed.

Syntax

<PUBLIC:ATTACH
    EVENT = oncontentready
    ONEVENT = sEventHandler
    FOR = element
    ID = sID
/>

Attributes

EVENT
Required. String that specifies the name of a Dynamic HTML (DHTML) event, or any of the events specific to the HTML Component (HTC) that are listed in the HTC Reference.
FOR
Optional. String that specifies one of the following values to identify the source of the event.
document Refers to the document object.
element Default. Refers to the element to which the behavior is attached.
window Refers to the window object.
ONEVENT
Required. String that specifies an inline script or a direct invocation of the event handler function.
ID
Optional. String that uniquely identifies the ATTACH element within the component. This attribute is analogous to the ID attribute in DHTML.

Remarks

The innerHTML property of the element might not return the correct value until this event fires.

Example

This example uses the oncontentready event on a page to display the value of the element's innerHTML property.

<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="show_innerHTML()" />

<SCRIPT LANGUAGE="JScript">
function show_innerHTML()
{
   window.alert ('innerHTML = ' + element.innerHTML);
}
</SCRIPT>

See Also

DHTML Behaviors, Implementing DHTML Behaviors in Script


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.