Php TinyMCE从我的HTML代码中删除CSS
我使用Javascript函数获取托管在服务器上的HTML文件的内容,然后将内容添加到TinyMCE编辑器中 这就是功能:Php TinyMCE从我的HTML代码中删除CSS,php,javascript,jquery,html,tinymce,Php,Javascript,Jquery,Html,Tinymce,我使用Javascript函数获取托管在服务器上的HTML文件的内容,然后将内容添加到TinyMCE编辑器中 这就是功能: function LoadTemplate(url) { $.post(url, function (data) { // Get the editor instance that we want to interact with. var ed = tinyMCE.get('html_editor'); ;
function LoadTemplate(url) {
$.post(url, function (data) {
// Get the editor instance that we want to interact with.
var ed = tinyMCE.get('html_editor');
;
// Insert the response into TinyMCE editor
ed.setContent(data, {format : 'raw'});
// Hide The Templates Div
HideTemplates();
}, "text");
}
在用户选择一个文件并单击Load template之后,HTML文件将毫无问题地插入到TinyMCE编辑器中,但是在单击submit之后,我在数据库中找到了文档的标题,并且TinyMCE删除了CSS in style标记
我向TinyMCE添加了常规选项:
element_format : "html",
verify_html : false,
但是我仍然得到相同的错误,默认情况下,TinyMCE只对文档的
部分中包含的页面内容感兴趣。如果您想让TinyMCE编辑文档的每个部分,特别是
部分,那么您需要完整的页面插件
谢谢您的回答,现在编辑器不会删除标题和正文,但仍然会删除标题中的任何CSS代码。有什么解决办法吗?@McShark读了这个谢谢你的解决办法,你救了我一天