HTML components (HTML Components)

xiaoxiao2021-03-06  68

One of HTML Components (HTML Components)

2004-06-17 10:55:27

HTML Components is one of the main extensions of IE5.0. It is also the most revolutionary, Microsoft's intentions use HTML components to replace ActiveX controls, like Active controls, HTML components are self-sustainable enclosed objects, can be once Develop any use, there are many benefits to using the HTML components, this article will reveal some of them!

The HTML component has brought a lot of new terms, ideas, objects, methods, and properties. I will accept these through a calendar application, this calendar application shows the current month, the current date is displayed, and the current date is displayed.

==== HTML behavior and HTC behavior ===

The HTML component encapsulates HTML content and can be inserted into other HTML documents. Before the HTML component, the only way to use custom control in the HMTL document is to use Microsoft ActiveX controls. One of the shortcomings of ActiveX controls is that the client must install HTML control before use, and on the other hand download the main page to the client. For DHTML's authors, HTML controls are more attractive because they can develop their own controls and components in the language they are familiar with, and HTC provides a simple mechanism to implement DHTML behavior in the script. An HTC file and HTML file do not have any difference, and ".htc" is a suffix, which includes scripts and a series of HTC custom description elements that define the properties, methods, events, etc. of HTML components, all HTC elements pass objects. The id attribute is used as an object in the script, and all methods and properties can be dynamically operated in the script.

You can use HTC to implement the following behavior:

* Set the properties and methods. Definition through "Property" and "Method" element

* Setting a custom event. Implement the "Event" element, "Fire ()" method is used to release the event,

Set the event environment via the "CreateEventObject () method.

* Access the DHTML object model of the HTML page that contains the HTC, use the HTC's "Element" object, return

An additional behavior element, using this object, HTC can access the object model (attributes, methods, events) that contains the text and its object model (attribute, method, event).

* Take a notification, implement the "attach" element, the browser not only informs the HTC standard DHTML event, but also

Know HTC two special events: OnContentReady events and the onDocumentReady event.

HTC encapsulates the definition of behavior. The first appearance of behavior is in IE5.0. The advanced behavior package in HTC is inhane and elemental mark separation. In IE5.0, the behavior in the script can be separated from the elements. Come out, and in IE5.5, the elements cannot be separated from their original behavior.

HTML Components (HTML Components)

2004-06-17 10:55:14

=== Define the tag and namespace ===

The basis of HTC is custom tag, and the first appearance of custom tags is in IE5.0, which allows the Web author to define a textbook structure through a series of styles associated with the structure, for example: You can define a new tag. (paragraph right)