Htc basics (4)-Events

Source: Internet
Author: User

** Event **

Ondocumentready event
Bytes --------------------------------------------------------------------------------------
This occurs when the document containing the action is completely parsed.

Format
<Public: attach
Event = ondocumentready
Onevent = seventhandler
For = Element
Id = Sid
/>

Attribute
Event
Required. Specifies a dynamic HTML (DHTML) event, or any string of events specified by the HTML component (HtC) listed in the HTC reference.
For
Optional. It is a string in the lower nominal value to identify the event source.
Document
Reference Document Object.
Element
Default value. The element that references the behavior connection.
Window
Reference the window object.
ID
Optional. Public in the component: the unique recognition string of the attach element. This attribute is similar to the ID attribute in DHTML.
Onevent
Required. The direct declaration of the event handler function or a specified string of an in-line script.

Remarks
An element connection will receive notifications from ondocumentready and oncontentready, but only after the window. onload event occurs.
For more information about how events occur during the initialization of an HTC file and its main document, see component initialization.

OndetachEvent
Bytes --------------------------------------------------------------------------------------
A behavior occurs before a connection is removed from an element.

Format
<Public: attach
Event = ondetach
Onevent = seventhandler
For = Element
Id = Sid
/>

Attribute
Event
Required. Specifies a dynamic HTML (DHTML) event, or any string of events specified by the HTML component (HtC) listed in the HTC reference.
For
Optional. It is a string in the lower nominal value to identify the event source.
Document
Reference Document Object.
Element
Default value. The element that references the behavior connection.
Window
Reference the window object.
ID
Optional. Public in the component: the unique recognition string of the attach element. This attribute is similar to the ID attribute in DHTML.
Onevent
Required. The direct declaration of the event handler function or a specified string of an in-line script.

Remarks
The ondetach event allows the behavior to be cleared before it completely disconnects from the element.
When you use the attachevent method to connect a behavior to an event that contains a leaf surface, this event allows the behavior to call the detachevent method to stop obtaining notifications from the leaf surface. When the public: attach element is used to connect a behavior to the leaf, the behavior will automatically stop obtaining the notification when it is unbound from the element, instead of using the detachevent method when an ondetach event occurs.

OncontentsaveEvent
Bytes --------------------------------------------------------------------------------------
The content of an element that is connected to an element action is saved or copied.

Format
<Public: attach
Event = oncontentsave
Onevent = seventhandler
For = Element
Id = Sid
/>

Attribute
Event
Required. Specifies a dynamic HTML (DHTML) event, or any string of events specified by the HTML component (HtC) listed in the HTC reference.
For
Optional. It is a string in the lower nominal value to identify the event source.
Document
Reference Document Object.
Element
Default value. The element that references the behavior connection.
Window
Reference the window object.
ID
Optional. Public in the component: the unique recognition string of the attach element. This attribute is similar to the ID attribute in DHTML.
Onevent
Required. The direct declaration of the event handler function or a specified string of an in-line script.

 

 

OncontentreadyEvent
Bytes --------------------------------------------------------------------------------------
It occurs when the content of the element connected to the behavior is completely parsed.

Format
<Public: attach
Event = oncontentready
Onevent = seventhandler
For = Element
Id = Sid
/>

Attribute
Event
Required. Specifies a dynamic HTML (DHTML) event, or any string of events specified by the HTML component (HtC) listed in the HTC reference.
For
Optional. It is a string in the lower nominal value to identify the event source.
Document
Reference Document Object.
Element
Default value. The element that references the behavior connection.
Window
Reference the window object.
ID
Optional. Public in the component: the unique recognition string of the attach element. This attribute is similar to the ID attribute in DHTML.
Onevent
Required. The direct declaration of the event handler function or a specified string of an in-line script.

Remarks
Before an event occurs, the innerhtml attribute of the element may not return the correct value.
When an event occurs and the literalcontent attribute of the public: component element is true, the text content of the element behavior is stored in the innerhtml attribute. This event indicates that the element behavior can access the innerhtml attribute.
This event is only valid for HTC components. The only way to bind an oncontentready event is to use the public: attach element. Attachevent cannot bind this event because it only works for standard DHTML events. When an HTC file is implemented as viewlink, The oncontentready event, or any other HTC event, cannot be connected to the element in the document fragment.
For more information about how events occur during the initialization of an HTC file and its main document, 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.