如何在使用文本编辑器时使javascript函数正常工作
var editor = $('#CKEditor1').ckeditorGet();
editor.on("instanceReady", function () {
this.document.on("keydown", function (event) {
console.log(editor.checkDirty());
if (event.data.key == 32)
alert('space bar pressed');
});
});
答案 0 :(得分:0)
尝试:
$("#CKEditor1").keydown(function(event){
if ( event.which == 112 ) {
event.preventDefault();
alert('F1 is pressed');
}
});