EWebEditor/注意事项

来自站长百科
跳转至: 导航、​ 搜索

EWebEditor | 安装说明 | 集成调用|可视化配置管理|表单接收|JavaScript API|常见问题及解答

1. 调用参数id与表单项名必须相同

如下面的代码中,"content1"必需是相同的,且区分大小写。

<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>作为原表单项时,要加入style="display:none"

<textarea name="content1" style="display:none"></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" style="display:none"><%=Server.HTMLEncode(str)%></textarea>

(PHP代码)

<input type=hidden name="content1" value="<?=htmlspecialchars($str)?>">

<textarea name="content1" style="display:none"><?=htmlspecialchars($str)?></textarea>

(JSP代码)

其中 htmlEncode 函数为自定义函数,在_example/standard.jsp中有提供。

<input type=hidden name="content1" value="<%=htmlEncode(str)%>">

<textarea name="content1" style="display:none"><%=htmlEncode(str)%></textarea>

(ASP.NET代码)

ASP.NET有两种调用方法,如果是iframe方式调用,则与ASP代码相同。如果是以用户控件方式调用,则在CodeBehind中赋值即可,如:

eWebEditorControl1.value = str

参考来源[ ]

EWebEditor使用手册导航

安装说明

集成调用

标准调用|弹窗调用|ASP.NET控件调用|注意事项

可视化配置管理

后台管理|样式管理|样式属性设置|工具栏管理|按钮管理|上传文件管理

表单接收

JavaScript API

常见问题及解答