我正在使用内联编辑器ipweditor工具,它在内部使用tinyMCE编辑器。在他们的演示页面上,它使用旧版本的tinyMCE,它不在我的IE中工作。所以我更新了tinyMCE的最新版本。TinyMCE返回无HTML内容
在老版本的TinyMCE中,它将所有HTML标签返回给我定义的内容,而在新版本中,它仅向我返回没有HTML标签的文本。 以下是jsFiddle demo的链接。任何人都知道我应该如何配置tinyMCE,以便它还返回HTML标签。
HTML
<div style="display:none">
<form method="post" action="somepage">
<textarea name="content" style="width:100%"></textarea>
</form>
</div>
<div style="border: solid thin gray; padding:5px;">
<div class="my_text"><b> <span>Click me! I am editable and WYSIWYG!!!</span></b>
</div>
的Javascript
$(document).ready(function() {
var ed = new tinymce.Editor('content', {
mode: "exact",
theme: "advanced",
plugins: "emotions,table",
theme_advanced_toolbar_location: "top",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
theme_advanced_buttons1: "bold,italic,underline,fontselect,fontsizeselect,forecolor,backcolor,|,code,",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
table_default_cellspacing: 0,
table_default_border: 1,
remove_linebreaks: false
});
$('.my_text').editable({
type: 'wysiwyg',
editor: ed,
onSubmit: function submitData(content) {
alert(content.current);
},
submit: 'save',
cancel: 'cancel'
});
});
确实'content.pervious'显示带有HTML标签的文本,但是我想用所有HTML标签编辑文本'content.current'。 – Nehal 2013-02-14 11:40:22
看起来像ipweditor不支持(或需要特别配置 - 检查文档)。解决这个问题的另一种方法是在提交之前使用tinymce编辑器命令(当ipweditor提交被调用时,编辑器对象不见了!)。 – Thariama 2013-02-14 12:43:44
@Tharima:是的,问题出在ipweditor上。它在内部创建tinyMCE的另一个对象,并以“文本”格式获取内容,需要用“html”替换它。 – Nehal 2013-02-14 13:58:38