如何在内容中insertHtml代码?
此方法不插入html代码:
CKEDITOR.instances['update_content'].setData(info_content);我试过了:
CKEDITOR.instances['update_content'].editable().insertHtml('<p>This is a new paragraph.</p>');但是我得到了一个错误:
ckeditor.js?v=3:407 Uncaught TypeError: Cannot read property 'checkReadOnly' of undefined
at ckeditor.js?v=3:407
at $.insertHtml (ckeditor.js?v=3:377)
at HTMLButtonElement.<anonymous> (shop:3750)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.r.handle (jquery.min.js:3)我需要动态内容,我需要改变CKEditor内容每点击按钮超文本标记语言代码。
发布于 2019-04-14 16:01:53
您不应该在editable()之后使用insertHtml,而应该使用以下代码:
CKEDITOR.instances['update_content'].insertHtml('<p>This is a new paragraph.</p>');https://stackoverflow.com/questions/54381017
复制相似问题