用htc实现html编辑器
来源:互联网 发布:wamp域名配置 编辑:程序博客网 时间:2024/04/28 08:24
HTC,全称为HTML Component,提供了在网页中用脚本进行组件开发的机制。下面的代码,在页面中嵌入一个html编辑器,只需要几行代码,只因为使用了一个预先定义好的html编辑组件。html编辑组件定义在文件"htmleditor.htc"中,使用的是javascript脚本。这个组件来自于一个免费软件:书包行CuteIE(一款用浏览器形式实现的多功能、可无限扩充的个人信息助理软件),如果程序安装在D盘的话,那么这个组件文件的路径是D:/Program Files/CuteIE/System/inc/cuteie_client/1_0/htmleditor.htc。
如果要将此组件使用在自己的网站中,只需要将组件文件htmleditor.htc和图片目录images放置到自己的网站目录下,然后修改下面代码中的相关路径指向(如IMPLEMENTATION、SystemImagesPath)即可。
<?XML:NAMESPACE PREFIX=HENS />
<?IMPORT NAMESPACE=HENS IMPLEMENTATION="/inc/cuteie_client/1_0/htmleditor.htc"/>
<hens:htmleditor id="htmleditor1" SystemImagesPath="/inc/cuteie_client/1_0/images/" width=100% height=400></hens:htmleditor>
<script language=javascript>
//提取html编辑器的内容,只需要以下代码即可。
var oContent=htmleditor1.content;
</script>
相关资源:
书包行CuteIE下载地址:http://www.cuteie.com/CuteIESetup.exe
官方网站:http://www.cuteie.com/
由于htmleditor.htc代码比较长,下面仅摘录组件的属性、事件定义部分。
<public:component tagname=htmleditor literalcontent=true>
<public:attach event=oncontentready onevent="oncontentready()" />
<public:property name="systemImagesPath" id="_hepropSystemImagesPath" GET="getSystemImagesPath" PUT="setSystemImagesPath"/>
<public:property name="content" id="_hepropContent" GET="getContent" PUT="setContent"/>
<public:property name="contentType" id="_hepropContentType" GET="getContentType" PUT="setContentType"/>
<public:event name="onblur" id="_heevtBlur"/>
</public:component>
- 用htc实现html编辑器
- 用VC实现Html编辑器
- HTML Component(HTC)
- HTML Component(HTC)
- HTML Component(HTC)
- HTML Component (HTC)
- HTML Component(HTC)
- HTML Component(HTC)
- HTML Component(HTC)
- HTML Component(HTC)
- javascript实现HTML在线编辑器
- 用VML+HTC+XML 实现的图表
- 用HTC来实现列表提示框
- HTC (HTML Component) 入门
- HTC实现表格控制
- HTC实现表格控制
- 如何快速实现HTML编辑器.NET组件
- 如何快速实现HTML编辑器.NET组件
- 任务管理器已被管理员停用 解决方法
- 用户模式下调用本机API
- Delphi中建议使用的语句(选择自 crbb 的 Blog )
- RemoteLib - DLL Injection for Win9x & NT Platforms
- 增加swap 区
- 用htc实现html编辑器
- 你说
- Eclipse基础--plugin插件安装
- T-Sql参考手册
- Web 窗体页的数据绑定表达式
- 向 Web 窗体页添加 Repeater 控件
- 三谈后台调用外部程序的完美实现
- Effective Java学习笔记(六)
- 经典25句话[转]