当前位置: 代码迷 >> Web前端 >> fckeditor ―― this.EditingArea替空或不是对象
  详细解决方案

fckeditor ―― this.EditingArea替空或不是对象

热度:77   发布时间:2012-08-21 13:00:22.0
fckeditor ―― this.EditingArea为空或不是对象
在win7环境下ie8、9,或firefox中,
FCKeditorAPI.GetInstance('content').SetHTML((record.content == "null") ? "" : record.content);
语句会产生错误:this.EditingArea为空或不是对象
问题原因:
在页面中使用了onload事件,该事件的调用方法中,使用了JS来设置FCKEditor的值(FCKEditor在当前页面中).
可以理解为还没有加载完FCKEditor就设置其值.所以会报错.

解决方案:
用onload事件填充EditingArea中的内容,将上面的语句放在全局方法FCKeditor_OnComplete中,页面加载时onload时调用该方法。
  相关解决方案