fckeditor编辑器其实是运行在一个iframe当中,所以常规的校验需要先通过fckeditor的api来进行连接后才能正常的进行操作。代码如下:
var oFCKeditor=FCKeditorAPI.GetInstance('content');
oFCKeditor.UpdateLinkedField();
alert(document.form[0].content.value);
在正常打开页面时如果加载完整的fck编辑器会使页面打开很慢,所以可以一开始通过以下方式变通。代码如下:
<TEXTAREA name="content" id="content" style="height=350;width=100%"></TEXTAREA><INPUT type="button" value="打开编辑器" onclick="showFKCEditer(this);">
function showFKCEditer(show_ob)
{
var oFCKeditor = new FCKeditor('content') ;
oFCKeditor.ToolbarSet = "MyBasic";
oFCKeditor.Config['SkinPath'] = '<%=request.getContextPath()%>/components/fckeditor/' + 'editor/skins/office2003/' ;
oFCKeditor.BasePath = '<%=request.getContextPath()%>/components/fckeditor/' ;
oFCKeditor.Height = 350 ;
//oFCKeditor.Width = '96%';
oFCKeditor.Value = '' ;
//oFCKeditor.Create() ;
oFCKeditor.ReplaceTextarea() ;
var cur_tr=findFirstParentTR(show_ob);
cur_tr.parentElement.removeChild(cur_tr);
}
不过在使用fck的api要先引入它的fckeditor/fckeditor.js包![]()
本文介绍了如何在网页中高效地使用 FCKeditor 编辑器。通过将编辑器加载过程与页面其他部分分离,可以显著提高页面加载速度。文中还提供了通过 JavaScript 控制 FCKeditor 的示例代码。
163

被折叠的 条评论
为什么被折叠?



