Public: ComponentElement
Bytes --------------------------------------------------------------------------------------
Specify the content of the file with HTC.
MicrosoftInternet Explorer 6New Content in
The literalcontent attribute supports nesting as a new possible value, and creates a nested text content element behavior.
Format
<Public: Component
Id = "Sid"
Lightweight = "blight"
Literalcontent = "sliteral"
Name = "sname"
Supportseditmode = "beditable"
Tagname = "stagname"
Urn = "surn"
>
<! -- Sub-Level element -->
</Public: component>
Attribute
ID
Optional. Public in the component: the unique character string recognized by the component element. This attribute is similar to the ID attribute in DHTML.
Lightweight
Optional. Specifies whether the HTC file contains a tag string. If the HTC file does not contain tags, set this attribute to true to improve performance. This attribute is valid for any HTC file.
True
The HTC file does not contain tags, so you do not need to parse and present custom tags each time. These tags are defined by the HTC file and used in the main document.
False
Default value. HTC contains custom tags that must be parsed and displayed. These tags are defined by the HTC file and used in the main document.
Literalcontent
Optional. Specifies whether the content contained in the custom tag is parsed and displayed, or as a string processed by the data island. This attribute is valid only when the HTC file defines an element action. You need to use the tagname attribute. For more information, see remarks.
False
Default value. The text and tags defined by the tagname attribute are parsed and displayed as data islands.
Nested
Internet Explorer 6 and later versions. Content within the first opening and last closing of the tag defined by the tagname attribute is treated as a data island and is not parsed or rendered. For more information, see use the literalcontent attribute.
True
Content within the first opening and last closing of the tag defined by the tagname attribute is treated as a data island and is not parsed or rendered.
Name
Optional. String that specifies the name of the behavior submitted in the main document.
Supporteditmode
Optional. Specifies whether the content of an HTC file can be edited. This attribute is valid only when the HTC file defines an element action.
True
The tags in the HTC file can be edited.
False
Default value. Tags contained in HTC files cannot be edited. You can set the iscontenteditable attribute to variant_true for each element in the HTC file to overload this attribute value.
Tagname
Optional. A string that specifies the custom tag name. The tag is defined by the HTC file and imported to the main document. This attribute is valid only when the HTC file defines an element action. For more information, see remarks.
Urn
Optional. String, in the unified Resource Name (URN) format, to uniquely identify this component. Therefore, it can be uniquely identified when multiple actions occur in the same name event. When an event occurs, the srcurn attribute of the event object is set to urn where the event is upstream.
Element Information
Child Element
At most once
Public: Defaults
Appears one or more times
Public: attach, public: event, public: method, public: Property
Remarks
Public: The component element can define two completely different types of behavior. One is join behavior. You can use the behavior Cascading Style Sheet (CSS) attribute to modify the behavior of an existing element. The second type is described in Internet Explorer 5.5, which is called an element action. An element behavior is used to define custom tags used in webpages like standard HTML tags.
An element action means the creation and use of a custom tag in a webpage. Therefore, when an HTC file defines an element behavior, it is necessary to define the tagname attribute of the public: component element. As previously pointed out, some attributes of this element are specially designed for element behavior. For more information, see query element behavior.
The name attribute is particularly useful when multiple behaviors are connected to the same element. Because it allows you to call attributes and methods that contain the behaviors required in the document. If multiple behaviors in a document are connected to a <span id = "myspan"> element, you can use the following format to set the delay attribute of the behavior named behaviorabc.
Myspan. behaviorabc. delay= 1000;
Public: attachElement
Bytes --------------------------------------------------------------------------------------
Binds a function to an event. Therefore, the function is called every time an event occurs on a special object.
Format
<Public: attach
Event = "sevent"
For = "sobject"
Id = "Sid"
Onevent = "seventhandler"
/>
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.
Element Information
Parent Element
Public: Component
Child Element
None
Remarks
Public: The attach element is a declaration of the attachevent method.
When a specified event is connected to a behavior element, the event processing part of the element is called first before the behavior event is processed. If multiple actions are connected to one element and multiple event processing parts are defined on the same event of the same element, the function will be called randomly after the element event processing part is called.
When providing a value for onevent, do not assign the name of an existing DHTML event to the event processing function. The name of an existing DHTML event may be recursively incorrect.
The event name is case sensitive to all scripting languages.