欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

fckediter javascript事件函数代码

程序员文章站 2022-03-07 08:57:41
demo: function fckeditor_oncomplete( editorinstance ) { editorinstance.editordocument....
demo:

function fckeditor_oncomplete( editorinstance )
{
editorinstance.editordocument.attachevent("onkeydown", editor_keydown);
editorinstance.editordocument.attachevent("onkeyup", editor_keyup);
}
function editor_keydown()
{
var oeditor = fckeditorapi.getinstance('inputmsg') ;
var keycode = oeditor.editorwindow.event.keycode;
if(keycode==13) {

}

}
function clearinput()
{
var oeditor = fckeditorapi.getinstance('inputmsg') ;
oeditor.commands.getcommand( "newpage" ).execute(); // oeditor.sethtml("") ;
}

function editor_keyup()
{
var oeditor = fckeditorapi.getinstance('inputmsg') ;
var keycode = oeditor.editorwindow.event.keycode;

if(keycode==13) {
clearinput();
}
}