Opened 10 years ago
Closed 10 years ago
#14678 closed Bug (invalid)
TypeError: Cannot read property 'setAttribute' of undefined
| Reported by: | sweta | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | File Browser | Version: | |
| Keywords: | Cc: |
Description
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. 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);
} this.fire('afterSetData', main.pageContainerEmailEditor.emaileditor.afterSetData());
}
}
});
Attachments (2)
Change History (5)
comment:1 Changed 10 years ago by
| Status: | new → pending |
|---|---|
| Version: | 4.5.7 |
Changed 10 years ago by
| Attachment: | setAttribute_Err.png added |
|---|
Changed 10 years ago by
| Attachment: | basic.html added |
|---|
comment:2 Changed 10 years ago by
Thanks for your quick reply.
1) I have created basic template in ckeditor to load every time when ckeditor render.
2) HTML code of this basic template is attached here in basic.html.
3) In that central td's are contentEditable=true always.But cannot insert characters, symbols, numbers..etc. Its like empty box.
4) In this central part of basic template we can put ck widgets and we can move, delete, apply css, and copy ck widgets.
5) So some time when I render ckeditor in my page I am getting issue TypeError: Cannot read property 'setAttribute' of undefined and sometime not.
6) I am getting this error at ckeditor.js line no 99.
setAttribute:function(){var a=function(a,b){this.$.setAttribute(a, b);return this};
comment:3 Changed 10 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | pending → closed |
I have tried your basic.html template and code you have provided. Still no luck.
Since I can't reproduce this issue, you are getting it only sometimes and you are getting it with your custom widget implementation, it really looks like implementation issue and not ckeditor bug. Because of that I need to close this issue as invalid for now.
In order to have it reopened and confirmed, I need you to provide reduced and working sample file/files (html, JS, CSS and whatever is needed) that can be put into default CKEditor and will show this issue.

Please provide more detail as I could not reproduce it.
ckeditor/samplesfolder and see the issue.