ueditor UEditor的setContent的時候報錯

今天在使用UEditor的setContent的時候報錯,報錯代碼以下javascript

TypeError: me.body is undefinedUncaught TypeError: Cannot set property 'innerHTML' of undefined 錯誤的緣由是沒有等UEditor建立完成就使用UEditor的setContent函數了,能夠經過以下代碼解決 方法一:java

ueditor.addListener("ready", function () {
ueditor.setContent('UEditor報錯TypeError: me.body is undefined');
});

方法二:函數

ueditor.ready(function() {
ueditor.setContent('UEditor報錯TypeError: me.body is undefined');
});
相關文章
相關標籤/搜索