我自己出現這個問題的時候是這樣的:
我先是在頁面上這樣引用ueditor:
<script id="editor_4" type="text/plain" style="width:100%;height:500px;"></script>
然后實例化:
var ue4 = UE.getEditor('editor_4');
所以,頁面上成功出現了一個編輯器的界面,但是在獲取編輯器里面的值的時候,就報錯了:
Cannot read property 'offsetWidth' of null
因為,我是這樣寫的:
var ProjectEnvironmental = UE.getEditor('ue4').getAllHtml()
錯誤的原因就是,我在UE.getEditor('ue4'),里面的值不是ue4,而是那個id,editor_4