ckeditor源码编辑模式,添加style、javascript内容丢失的解决

  • 我使用ckeditor 我在编辑的使用源码编辑,保存内容包含javascript、style标签的时候,数据库中有javascript、style标签 ,

  • 输入到页面也可以执行,但是我再次编辑的时候就不见了。添加allowedContent: true就可以了

  • CKEDITOR.replace( 'textarea_id', { allowedContent: true});

  • 也可以通过在config.js中添加config.allowedContent = true;实现 

  • 注:版本4.0
原文地址:https://www.cnblogs.com/baker95935/p/7675590.html