UEditor的setContent的时候报错,报错代码如下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错
2016-10-27 08:44
465 查看
原因是没有等UEditor创建完成就使用UEditor的setContent函数了,可以通过如下代码解决 方法一:
ueditor.addListener("ready", function () {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});
方法二:
ueditor.ready(function() {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});
ueditor.addListener("ready", function () {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});
方法二:
ueditor.ready(function() {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});
相关文章推荐
- 使用UEditor的setContent的时候报错,报错代码如下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错
- 使用form的方法(例如:reset,clear等)报错Uncaught TypeError: Cannot read property 'tip' of undefined(…)的原因
- Uncaught TypeError: Cannot set property 'applyDefaults' of undefined
- Uncaught TypeError: Cannot set property 'display' of undefined错误
- H5拖放事件 "Uncaught TypeError: Cannot read property 'setData' of undefined"
- 关于Uncaught TypeError: Cannot set property 'onClick' of null。的问题
- Uncaught TypeError: Cannot read property 'substring' of undefined
- 解答为什么Extjs5中mask.show()不工作了并报错Uncaught TypeError: Cannot call property 'mask' of undefined
- javascript Uncaught TypeError: Cannot read property ... of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- util.js:68 Uncaught TypeError: Cannot read property 'fn' of undefined
- JS —— Uncaught TypeError: Cannot read property 'slice' of undefined 错误
- Uncaught TypeError: Cannot read property 'substring' of undefined
- tankgame2.js:37 Uncaught TypeError: Cannot read property 'direct' of undefined(…)
- Uncaught TypeError: Cannot read property 'msie' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- Hexo: TypeError: Cannot set property 'lastIndex' of undefined
- ASP.NET MVC运行出现Uncaught TypeError: Cannot set property __MVC_FormValidation of null的解决方法
- Uncaught TypeError: Cannot read property 'msie' of undefined
- aes.js:77 Uncaught TypeError: Cannot read property 'extend' of undefined(…)