June 26, 2000 - Element Components' Terminology
![]() |
June 26, 2000 Element Components' Terminology Tips: June 2000
Yehuda Shiran, Ph.D.
|
Here are the top six lines of an element component, in today.htc:
<HTML XMLNS:TODAY>
<HEAD>
<PUBLIC:COMPONENT tagName="DAY">
<PROPERTY NAME="value"></PROPERTY>
<ATTACH EVENT="oncontentready" ONEVENT="fnInit()"></ATTACH>
</PUBLIC:COMPONENT>
The name of the element component (namespace) is TODAY. There is one custom tag defined, DAY. The behavior adds one property to it (value) and one event (oncontentready).
Now, suppose you want to call this element component from another page, calendar.htc. You have to make sure its header includes its own namesapce, as well as the one positioned (called) on the page. In this case, its own namespace is MYCAL, and it calls ANYDAY and TODAY:
<HTML XMLNS:MYCAL XMLNS:TODAY XMLNS:ANYDAY>
Somewhere, you need to load the page today.htc before you use it in calendar.htc:
<?IMPORT NAMESPACE="TODAY" IMPLEMENTATION="today.htc"/>And, finally, you position it somewhere on the page:
<ANYDAY:DAY value=31></ANYDAY:DAY>


Find a programming school near you