Home  >  Article  >  Web Front-end  >  One of HTML components (HTML COMPONENTS)

One of HTML components (HTML COMPONENTS)

黄舟
黄舟Original
2016-12-17 13:44:541765browse

HTML component (HTML COMPONENTS) is one of the main extensions of IE5.0, and it is also the most revolutionary. Microsoft's intention is to use HTML components to replace ACTIVEX controls. Like ACTIVE controls, HTML components are self-sustaining closed objects that can be developed once and used at will. There are many benefits to using HTML components, and this article will reveal some of them to you!
HTML components bring a lot of new terms, ideas, objects, methods, and properties, and I'll introduce them to you through a calendar application that displays the day of the month, the day of the week, and highlights the current date.

====HTML Behavior and HTC Behavior===

HTML component encapsulates HTML content and can be inserted into other HTML documents. Before the emergence of HTML components, the only way to use custom controls in HMTL documents was to use Microsoft ACTIVEX controls. One of the disadvantages of ACTIVEX controls is that the client must install the HTML control before use. On the other hand, the main page must be downloaded to the client. , HTML controls are more attractive to DHTML authors because they can develop their own controls and components using a language they are familiar with, and HTC provides a simple mechanism to implement DHTML behaviors in scripts. There is no difference between an HTC file and an HTML file, and has the suffix ".htc". It includes scripts and a series of HTC custom description elements. These elements define the attributes, methods, events, etc. of HTML components. All HTC elements pass objects The ID property is used as an object in scripts, and all methods and properties can be dynamically manipulated in scripts.
You can use HTC to achieve the following behaviors:
*Set properties and methods. Defined by the "PROPERTY" and "METHOD" elements
*Set custom events. Implemented through the "EVENT" element, use the "fire()" method of the element to release the event.
Set the event environment through the "createEventObject()" method.
*Access the DHTML object model of the HTML page containing the HTC, use the HTC "element" object, and return
An element with attached behavior. Using this object, HTC can access the object model containing the document and its objects (properties, methods, events).
* Receive notifications, implemented using the "ATTACH" element. The browser not only notifies HTC of standard DHTML events, but also
We know HTC’s two special events: oncontentready event and ondocumentready event.
HTC encapsulates the definition of behavior , the concept of behavior first appeared in IE5.0. The advanced behavior encapsulation in HTC means that behavior cannot be separated from element tags. In IE5.0, behavior can be separated from elements in scripts, while in IE5. 5, elements cannot be separated from their original behavior

The above is the content of one of the HTML COMPONENTS. For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn