无法读取未定义ckeditor的属性'getComputedStyle' [英] Cannot read property 'getComputedStyle' of undefined ckeditor

查看:745
本文介绍了无法读取未定义ckeditor的属性'getComputedStyle'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站上使用ckeditor,并且在加载页面时不时出现此错误,该错误会阻止ckeditor:

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"

这是初始化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?

谢谢!

推荐答案

我遇到了类似的错误,它是由调用$('#id').empty();引起的. 遵循了这篇文章中的想法:

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

如何清除以下内容:没有innerHTML ='';

并使用以下代码:

var node = document.getElementById('id');
 while (node.hasChildNodes()) {
    node.removeChild(node.firstChild);
}

这篇关于无法读取未定义ckeditor的属性'getComputedStyle'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆