Opened 8 years ago

Closed 8 years ago

#14679 closed Bug (duplicate)

TypeError: Cannot read property 'setAttribute' of undefined

Reported by: sweta Owned by:
Priority: Normal Milestone:
Component: File Browser Version:
Keywords: Cc:


Currently I am using ckeditor version 4.5.7. and in this version I am facing issue with "Uncaught TypeError: Cannot read property 'setAttribute' of undefined" for body element. body.setAttribute("contentEditable", false); Code is as below. Its working fine in firefox. But problem with ie and chrome.

edtr = CKEDITOR.replace(id, {

on: {

'instanceReady': function(evt) {

insert = CKEDITOR.getTemplates('default');

var editor = evt.editor; var body = editor.document.getBody(); body.setAttribute("contentEditable", false);

var disableEvent = function(evt) {

evt.cancelBubble = true; evt.returnValue = false; evt.preventDefault(); evt.stopPropagation();

return false;


if (editor.document.$.addEventListener) {

editor.document.$.addEventListener('dragover', disableEvent, true); editor.document.$.addEventListener('drop', disableEvent, true);

} else if (editor.document.$.attachEvent) {

editor.document.$.attachEvent('ondragover', disableEvent, true); editor.document.$.attachEvent('ondrop', disableEvent, true);

}'afterSetData', main.pageContainerEmailEditor.emaileditor.afterSetData());




Change History (1)

comment:1 Changed 8 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed
Version: 4.5.7

DUP of #14678.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy