当前位置:主页 > 查看内容

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

发布时间:2021-04-21 00:00| 位朋友查看

简介:1、挂接事件,比如onkeydown事件,要在FCKeditor_OnComplete里实现: 复制代码 代码如下: function FCKeditor_OnComplete( editorInstance ) { if (document.all) // IE editorInstance.EditorDocument.attachEvent("onkeypress", FCKeditor_OnKeyup) ; else……
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。

本文转载自网络,原文链接:https://m.jb51.net/article/20621.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:FCK 编辑器焦点问题 下一篇:没有了

推荐图文


随机推荐