Learn more about the events in HTC

Source: Internet
Author: User
Tags format object bind contains connect reference string window
Htc

Ondocumentready Events
--------------------------------------------------------------------------------------
Occurs when the document that contains the behavior is completely parsed.

Format
<public:attach
EVENT = Ondocumentready
ONEVENT = Seventhandler
for = Element
ID = SID
/>

Property
EVENT
must be selected. Specify a dynamicHTML (DHTML)event, or anything inHtcThe references listed in theHtmlComponent(HTC)A string that specifies the event.
For
Optional. A string specified as a value in the lower face to identify the event source.
Document
ReferenceDocumentobject.
Element
The default value. The element that refers to the behavior connection.
Window
ReferenceWindowobject.
Id
Optional. Within the componentPublic:attachthe unique identifying string for the element. This property is similar to theDhtmlin theIdProperties.
ONEVENT
must be selected. A direct declaration of an event-handler function or a specified string of script within a row.

Note
a connection to an element will receive notifications from Ondocumentready and Oncontentready , but only after the Window.onload event occurs.
about in a The overall view of the HTC file and the events that occurred during the initialization of its main document, see component initialization.

Ondetach Events
--------------------------------------------------------------------------------------
Occurs before an element is released from a connection to a behavior.

Format
<public:attach
EVENT = Ondetach
ONEVENT = Seventhandler
for = Element
ID = SID
/>

Property
EVENT
must be selected. Specify a dynamicHTML (DHTML)event, or anything inHtcThe references listed in theHtmlComponent(HTC)A string that specifies the event.
For
Optional. A string specified as a value in the lower face to identify the event source.
Document
ReferenceDocumentobject.
Element
The default value. The element that refers to the behavior connection.
Window
ReferenceWindowobject.
Id
Optional. Within the componentPublic:attachthe unique identifying string for the element. This property is similar to theDhtmlin theIdProperties.
ONEVENT
must be selected. A direct declaration of an event-handler function or a specified string of script within a row.

Note
The Ondetach event allows the behavior to do some cleanup work before it completely disconnects from the element.
When you use the Attachevent method to connect an action to an event that contains a leaf, this event allows the behavior to call the DetachEvent method to stop getting notifications from the foliage. When a public:attach element is used to connect an action to a time on a surface, the behavior automatically stops getting the notification when it is disconnected from the element, without the need to use the detachevent when the Ondetach event occurs method.

Oncontentsave Events
--------------------------------------------------------------------------------------
The content of an element that is connected to an element behavior occurs before it is saved or copied.

Format
<public:attach
EVENT = Oncontentsave
ONEVENT = Seventhandler
for = Element
ID = SID
/>

Property
EVENT
must be selected. Specify a dynamicHTML (DHTML)event, or anything inHtcThe references listed in theHtmlComponent(HTC)A string that specifies the event.
For
Optional. A string specified as a value in the lower face to identify the event source.
Document
ReferenceDocumentobject.
Element
The default value. The element that refers to the behavior connection.
Window
ReferenceWindowobject.
Id
Optional. Within the componentPublic:attachthe unique identifying string for the element. This property is similar to theDhtmlin theIdProperties.
ONEVENT
must be selected. A direct declaration of an event-handler function or a specified string of script within a row.

Oncontentready Events
--------------------------------------------------------------------------------------
Occurs when the contents of the element that connect the behavior are completely parsed.

Format
<public:attach
EVENT = Oncontentready
ONEVENT = Seventhandler
for = Element
ID = SID
/>

Property
EVENT
must be selected. Specify a dynamicHTML (DHTML)event, or anything inHtcThe references listed in theHtmlComponent(HTC)A string that specifies the event.
For
Optional. A string specified as a value in the lower face to identify the event source.
Document
ReferenceDocumentobject.
Element
The default value. The element that refers to the behavior connection.
Window
ReferenceWindowobject.
Id
Optional. Within the componentPublic:attachthe unique identifying string for the element. This property is similar to theDhtmlin theIdProperties.
ONEVENT
must be selected. A direct declaration of an event-handler function or a specified string of script within a row.

Note
The innerHTML property of the element may not return the correct value until the event occurs.
When an event occurs and the Public:component element's Literalcontent property is true, the literal content of the element behavior is stored in the innerHTML property. This event indicates that the element behavior can access the innerHTML property.
Because this event is only valid for HTC components, the only way to bind the Oncontentready event is to use the Public:attach element. Attachevent cannot bind this event because it works only on standard DHTML events. When an HTC file is implemented as a viewlink, the Oncontentready event, or any other HTC-specific event, cannot be connected to elements in a document fragment.
For a general view of the event occurring during an HTC file and its main document initialization, see component initialization.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.