chcę aby po odciśnieciu klawisza lub wcisnieciu wykonała się funkcja.
Próbuje w ten sposób ale nie dostaję żadnego alertu ani komunikatu że coś jest nie tak.
<script type="text/javascript"> function CKEditor_OnComplete( editorInstance ) { if (document.all) { // IE editorInstance.EditorDocument.attachEvent("onkeyup", my_function) ; } else { // other browser editorInstance.EditorDocument.addEventListener( 'keyup', my_function, true ) ; } } function my_function() { alert('hej'); } </script>
EDIT:
W ten sposób sobie porawdzilem zamiast skryptu powyżej wystarczy ten:
<script type="text/javascript"> CKEDITOR.on('instanceCreated', function(e) { e.editor.on('contentDom', function() { e.editor.document.on('keyup', function(event) { // keyup event in ckeditor alert('test'); } ); }); }); </script>