how can i make the javascript function to work while using text editor
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');
});
});