0

I use ckeditor on my website, and from time to time when I load my page I get this error which blocks the ckeditor:

"Cannot read property 'getComputedStyle' of undefined ckeditor"

Here's the code that initializes the ckeditor :

 CKEDITOR.replace('TA_comments', {
     toolbar: 'MyToolbar_user',
     on: {
         'instanceReady': function (evt) {
             //Set the focus to your editor
             CKEDITOR.instances.TA_comments.focus();
         }
     }
 });

Any idea where it can come because it's really a random problem on all browsers?

Thanks !

Taryn
  • 242,637
  • 56
  • 362
  • 405
Stylix
  • 1
  • 1
  • 1
  • 3

5 Answers5

1

I was getting a similar error and it was caused by calling $('#id').empty(); Followed the ideas in this post:

How do I clear the contents of a div without innerHTML = "";

and used this code:

var node = document.getElementById('id');
 while (node.hasChildNodes()) {
    node.removeChild(node.firstChild);
}
Community
  • 1
  • 1
jbrahy
  • 4,228
  • 1
  • 42
  • 54
0

I found the problem. It was a problem with a jquery plugin mscustomscrollbar. To resolve this I deleted the plugin and used css3 to style scrollbar.

Stylix
  • 1
  • 1
  • 1
  • 3
0

I Had the same problem. My solution was: Client was using adblock pro, and I found out that in adblock our page that is using ckeditor is blocked! Removed our page from adbblock and it works fine now!

0

I was also facing same issue. I put a delay on the .replace() and it's working fine now. As this is not a good solution I Know but I didn't find the exact cause and also it's generating randomly so finally I put a setTimeout() and the problem has been resolved

0

As per this issue using divarea plugin will solve this by replacing iframe used in editable area with a div

mohas
  • 1,911
  • 1
  • 16
  • 20