HTML Components

From Wikipedia, the free encyclopedia
Jump to: navigation, search

HTML Components (HTCs) are a nonstandard mechanism to implement components in script as Dynamic HTML (DHTML) "behaviors"[1] in the Microsoft Internet Explorer web browser. Such files typically use an .htc extension and the "text/x-component" MIME type.[2]

An HTC is typically an HTML file (with JScript / VBScript) and a set of elements that define the component. This helps to organize behavior encapsulated script modules that can be attached to parts of a Webpage DOM.

Example[edit]

<body>
<ul>
  <li style="behavior:url(hilite.htc)">Foo Foo Foo</li>
</ul>
</body>

In this example, the li element is given the behavior defined by "hilite.htc" (a file that contains JScript code defining highlight/lowlight actions on mouse over). The same hilite.htc can then be given to any element in the HTML page - thus encapsulating the behavior defined by this file.

References[edit]

  1. ^ Introduction to DHTML Behaviors
  2. ^ MIME Types in IIS

External links[edit]