I wish to add the 'Are you sure you want to leave this page' dialog to avoid page editors losing material accidentally.
This certainly works for normal textareas.
Obviously I can't be sure if this is a CKeditor bug or a jQuery bug, or is by design on either side.
When using CKEditor with jQuery one should use jQuery adapter for it. Currently there is one bug I’m aware of - #8530 (Toolbar save button does not sent updated content). If you are using that button a lot then I’m not recommending the adapter. If not please see - http://ckeditor.com/blog/CKEditor_for_jQuery, there is also jQuery adapter sample file in _samples folder of downloaded CKEditor.
Editor is created upon an input element (textarea). After that its "onchange" listener will not be triggered anymore (not jQuery dependent) as the original element is hidden from view.
You should rather leave window.onbeforeunload and display message provided that editor editor is dirty (checkDirty returns true).