eWebEditor(首页) >> 在线文档 >> 开发手册 >> 集成调用

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>作为原表单项时,要加入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>