ckeditor html不显示 ckeditor 自动过滤html

作者:如沐春风 | 创建时间: 2023-04-13
我使用ckeditor 我在编辑的使用源码编辑,保存内容包含javascript、style标签的时候,数据库中有javascript、style标签 , 输入到页面也可以执行,但是我再次编辑的时候就不见了 ckeditor 自动过滤htm...
ckeditor html不显示 ckeditor 自动过滤html

操作方法

我使用ckeditor 我在编辑的使用源码编辑,保存内容包含javascript、style标签的时候,数据库中有javascript、style标签 , 输入到页面也可以执行,但是我再次编辑的时候就不见了。添加allowedContent: true就可以了

CKEDITOR.replace( 'textarea_id', { allowedContent: true}); Note that textarea_id in the code above is the id attribute of the <textarea> element to be replaced. The allowedContent in the code above is set to true to disable content filtering. Setting this option is not obligatory, but in full page mode there is a strong chance that one may want be able to freely enter any HTML content in source mode without any limitations.

点击展开全文

更多推荐