使用UEditor的setContent的時候報錯,報錯代碼以下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 錯javascript
緣由是沒有等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'); });