当FCKeditor 2 textarea中输入内容时,需要触发自定义javascript函数。但是,我搜索了很多,找不到答案。想以某种方式为textarea添加onkeypress =“customfunction()”。在fckeditor中按下某个键时触发javascript函数
感谢您的帮助!
当FCKeditor 2 textarea中输入内容时,需要触发自定义javascript函数。但是,我搜索了很多,找不到答案。想以某种方式为textarea添加onkeypress =“customfunction()”。在fckeditor中按下某个键时触发javascript函数
感谢您的帮助!
设法找到用词的一些提示到底什么。即使在FCKeditor 2.0上,如何做一个onkeypress。您需要在调用编辑器代码后加载此JavaScript:
function FCKeditor_OnComplete(editorInstance){
if (document.all) { // If Internet Explorer.
editorInstance.EditorDocument.attachEvent("onkeydown", function(event){alert('key was pressed');}) ;
} else { // If Gecko.
editorInstance.EditorDocument.addEventListener('keypress', function(event){alert('key was pressed')}, true) ;
}
}
这似乎工作:
CKEDITOR.instances.<yourEditorname>.document.on('key', function(event) { });