Tinymce在提交时删除属性

Tinymce在提交时删除属性,tinymce,Tinymce,Tinymce从所有元素中丢失内联样式。我几乎什么都试过了 language : "fi", theme : "advanced", plugins : "style,paste,table,media,layer,fullscreen,autoresize", theme_advanced_disable : "help,sub,sup,anchor", theme_advanced_buttons1_add : "styleprops,fontselect,f

Tinymce从所有元素中丢失内联样式。我几乎什么都试过了

language : "fi", theme : "advanced", plugins : "style,paste,table,media,layer,fullscreen,autoresize", theme_advanced_disable : "help,sub,sup,anchor", theme_advanced_buttons1_add : "styleprops,fontselect,fontsizeselect,forecolor", theme_advanced_buttons2_add : "pastetext,pasteword", theme_advanced_buttons3 : "tablecontrols,hr,removeformat,media,fullscreen", remove_linebreaks : true, remove_trailing_nbsp : true, relative_urls : false, remove_script_host : false, entity_encoding : "raw", fix_nesting: true, theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_resize_horizontal : true, theme_advanced_resizing : true, theme_advanced_path_location : "bottom", file_browser_callback : 'myFileBrowser', valid_elements : '*[*]', inline_styles : true 语言:“fi”, 主题:“高级”, 插件:“样式、粘贴、表格、媒体、图层、全屏、自动调整大小”, 主题\u高级\u禁用:“帮助、辅助、辅助、锚定”, 主题\高级\按钮1\添加:“styleprops、fontselect、fontsizeselect、forecolor”, 主题\高级\按钮2\添加:“粘贴文本,粘贴单词”, 主题\u高级\u按钮3:“桌面控件、hr、removeformat、媒体、全屏”, 删除换行符:true, 删除尾随:true, 相对URL:false, 删除\u脚本\u主机:false, 实体_编码:“原始”, 固定嵌套:正确, 主题\高级\工具栏\位置:“顶部”, 主题\高级\工具栏\对齐:“左”, 主题\u高级\u调整大小\u水平:正确, 主题\u高级\u大小调整:正确, 主题\高级\路径\位置:“底部”, 文件浏览器回调:“myFileBrowser”, 有效的_元素:'*[*]', 内联样式:true 我不认为有更多的事情可以让用户去做。但仍然如此。当我单击我的表格,打开属性,将宽度更改为600,然后查看HTML时,它会显示style=“width:600px”

但是,当我提交它时,下一页将不会获得该样式属性。这让我很生气,我不知道该往哪里看,因为我所做的一切都没有改变什么。我的语法有问题吗,我看不出来,因为我太生气了还是什么?还有其他想法吗


感谢

在特殊事件中,编辑器的内容会被写回以前的html元素。Tinymce具有内置的清理功能,可根据Tinymce设置清理内容(通常在保存和提交时进行)。您必须检查以下tinymce设置:


确保表可以具有width属性。

我使用以下配置,没有此类问题:

tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
});

你认为你必须设置有效的元素吗?我还没准备好,对我来说很好。可能是默认设置效果更好。tinyMCE minorVersion:“3.9.3”,发布日期:“2010-12-20”

您可能错过了配置中的有效元素:“[]”行。抱歉,您错过了该行。如何提交编辑器内容?你使用哪种浏览器?我有谷歌Chrome,它是一个普通格式的普通文本区,使用POST-to-POST到下一个PHP文件,然后(现在)打印出来。我还使用FirefoxOk对其进行了测试,所以我想在发送请求时,宽度属性已经丢失了。您可以尝试一件事:单击submitbutton时首先调用thuis:tinymce.triggerSave();告诉我这是否有什么不同,好吧,我尝试一下,也许在调试器中对javascript进行一些中断,看看会发生什么。