eWebEditor的使用教程 
3.3.1 标准调用
要把eWebEditor集成到你原有的web应用系统中,你基本只需在原来的代码上,再加上一行如下形式的代码即可。
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
参数说明:
l          /ewebeditor.htm应改为你实际安装的路径
l          参数id: 相关联的表单项名,也就是提交保存页要引用的表单项名,多个调用时,请保证id不同,可参见后面例子
l          参数style: 使用的样式名,可以是标准的样式名或自定义的样式名,如果使用标准coolblue可留空
l          width, height: 根据实际需要设置,eWebEditor将自动调整与其适应
l          在后台管理中,可以得到每个样式的最佳调用代码
l          更多参数,请见参数设置说明
 
例子:新增表单
 
在未使用eWebEditor前,你原来新增内容的表单可能是如下形式:
<textarea name="content1" rows=10 cols=50></textarea>
 
使用eWebEditor后,现在是如下形式:
<input type="hidden" name="content1" value="">
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
editor版本
或者
<textarea name="content1" ></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
 
例子:修改表单
 
你原来可能是:
<textarea name="content1" rows=10 cols=50><%=Server.HTMLEncode(s_Content)%></textarea>
 
现在是:
<input type="hidden" name="content1" value="<%=Server.HTMLEncode((s_Content)%>">
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
或者
<textarea name="content1" ><%=Server.HTMLEncode((s_Content)%></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
 
 
3.3.4 注意事项
1. 调用参数id与表单项名必须相同
如,下面的代码中,蓝部分必需是相同的,且区分大小写。
<input type="hidden" name="content1" value="">
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" height="350"></iframe>
 
2. eWebEditor允许在同一表单里有多个实例,所以请保证id在整个网页中是唯一的。
如:
<form>
<input type="hidden" name="content1" value="">
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" height="350"></iframe>
 
<input type="hidden" name="content2" value="">
<iframe ID="eWebEditor2" src="/ewebeditor.htm?id=content2&style=coolblue" frameborder="0" scrolling="no" width="500" height="350"></iframe>
</form>
 
3. 在使用<textarea>作为原表单项时,要加入
<textarea name="content1" ></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" height="350"></iframe>
 
4. 当使用<input>形式做为修改表单时,一定要用双引号,不能用单引号,且要加HTMLEncode函数,否则有可能内容被截掉。
 
例如:
(ASP代码)
<input type=hidden name="content1" value="<%=Server.HTMLEncode(str)%>">
<textarea name="content1" ><%=Server.HTMLEncode(str)%></textarea>
 
(PHP代码)
<input type=hidden name="content1" value="<?=htmlspecialchars($str)?>">
<textarea name="content1" ><%=htmlspecialchars($str)%></textarea>
 
 
3.4.1 大文本处理
此功能仅限于ASP环境版本。
ASP开发环境中,一个输入框有102399字节的限制(100K左右),大文本内容不能使用正确提交及接收.eWebEditor自带有对此限制的处理机制,不会受此条件的约束,理论上支持无限大文件。
但在接收表单提交过来的内容时,应注意使用下面的方法。
 
普通的取值方法:
<%
  sContent = Request.Form("content1")
%>
 
大文本的取值方法:
<%
sContent = ""
For i = 1 To Request.Form("content1").Count
  sContent = sContent & Request.Form("content1")(i)
Next
%>
 
3.10 常见问题及解答
 
问:我不会任何HTML语法及没有任何主页制作经验,能用好这个编辑器吗?
答:绝对没有任何问题,因为编辑器是完全所见即所得的,所以HTML语法都在后台自动生成。至于使用方面,本编辑器也尽量做到简单易用,相信您能在短时间内学会使用这个功能强大的编辑器的。
 
问:与普通文本输入框相比,HTML编辑器有什么优势之处?
答:最大的优势就是让使用者更方便快捷地编写出各种不同样式及效果的HTML内容,以往普通文本输入框要实现这些HTML效果的内容就需要使用者具备一定的HTML语法或UBB语法,而且编写内容的时候是手工编写代码方式的,除了不直观以外,还经常出现编写好内容
并输出后才发现效果不理想等情况。而使用HTML编辑器则完全杜绝了这些情况的发生。
 
问:为什么我无法使用编辑器的部分或全部功能?
答:因为编辑器使用了JAVASCRIPT客户端语言,如果浏览器不支持JAVASCRIPT或关闭了这个功能的话,编辑器就不能正常工作了。另外,编辑器还需要使用者的浏览器版本是IE5.5以上,否则编辑器同样不能正常工作。
 
问:为什么我在修改内容的时候有些内容会跑出编辑区?
答:因为内容都是以HTML格式保存的,如果你在赋值的时候没有对内容进行字符转换,则会以HTML格式进行解释,所以请一定在赋值时加入HTMLEncode()函数。如:
(ASP)
<textarea name=content><%=Server.HTMLEncode(str)%></textarea>
(PHP)
<textarea name=content><?=htmlspecialchars($str)?></textarea>
 
问:我的程序放在一般的虚拟主机上,没有FSO或上传组件支持,能使用上传功能吗?(ASP)
答:可以。因为eWebEditor上传功能的实现可以使用无组件文件上传类,所以无需上传组件的支持也能正常使用上传功能。
 
问:我转原来系统的在线编辑为eWebEditor时,为什么显示出来都是HTML格式源代码?
答:因为很多现有的系统使用的都是UBB之类的编码,都有进行字符转换,有可能在保存或显示页,你把保存或显示页的所有字符转换函数去掉就可以了,因为eWebEditor存的就是HTML格式的代码。