ueditor UEditor的setContent的時候報錯


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

TypeError: me.body is undefinedUncaught TypeError: Cannot set property 'innerHTML' of undefined 錯誤的原因是沒有等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');
});


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM