FCKEditor网页编辑器 几点使用心得

编程学习 2021-07-05 12:51www.dzhlxh.cn编程入门
FCKEditor网页编辑器 几点使用心得,需要的朋友可以参考下。
1、挂接事件,比如onkeydown事件,要在FCKeditor_OnComplete里实现:
代码如下:

function FCKeditor_OnComplete( editorInstance )
{
if (document.all) // IE
editorInstance.EditorDocument.attachEvent("onkeypress", FCKeditor_OnKeyup) ;
else// other browser
editorInstance.EditorDocument.addEventListener( 'onkeypress', FCKeditor_OnKeyup, true );
}

2、挂接后如果调用了fckeditor的SetHTML函数,则挂接事件会失效,要改用oEditor.EditorDocument.body.innerHTML来设置内容即可。
3、用window.event.keyCode只能取到null值,要用FCKeditorAPI.GetInstance('FCKeditor1').EditorWindow.event.keyCode。
4、按回车符后生成的是是<br>还是<p>由fckconfig.js文件里的FCKConfig.EnterMode/FCKConfig.ShiftEnterMode决定,也可动态设置但属性名不是FCKConfig,而是Config。

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板