当前位置: 移动技术网 > IT编程>脚本编程>编辑器 > FCKEditor网页编辑器 几点使用心得

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

2017年12月08日  | 移动技术网IT编程  | 我要评论
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。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网