eWebEditor 中的简单问题 20分

来源:百度知道 编辑:UC知道 时间:2024/06/18 02:32:32
页面中插入<IFRAME ID="eWebEditor1" src="../ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="yes" width="700" height="350"></IFRAME>

然后想用js对eWebEditor中的输入框加些文字,是这样用吗?那个ID我不知道是什么啊,怎么办
document.getElementById("eWebEditor").value+="<img src=\"";

首先你可以去eWebEditor的官方网站下载一个eWebEditor Version 4.6.0 精简版,地址如下:http://www.ewebeditor.net/download.asp
解压缩你下载的文件包(我下载的是eWebEditor_V4.60_CHS_Lite_Build070311.rar)
其中有一个文件夹(名字叫:_example),这里面有一个clientapi的HTM文件,有关于JS等外部调用的API详细例子,像你要添加内容,就有“当前位置插入”、“尾部追加”等几种形式。具体的你可以查看源代码。
大致调用语句是:
<INPUT type=button value="当前位置插入" onclick="eWebEditor1.insertHTML('This is insertHTML function!')">
<INPUT type=button value="尾部追加" onclick="eWebEditor1.appendHTML('This is appendHTML function!')">