htc files: Why not to use them?

做~自己de王妃 提交于 2019-12-05 12:12:58

Quoting Wikipedia:

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.

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.

In two paragraphs, the following are mentioned:

  • Internet Explorer
  • JScript
  • VBScript
  • nonstandard

I think it's obvious why not everybody is using this technology.

Thomas Aylott

How to use border-radius.htc with IE to make rounded corners

The server has to server the HTC with the correct MIME type (text/x-component)

That alone is enough to stop JavaScript frameworks such as jQuery or MooTools from being able to use them. The dependency on configuring anything a server in order to get client-side functionality working is beyond unacceptable.

It's a real pity though, htc files really are capable of a lot of interesting things.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!