Javascript Tinymce未正确显示html?
我有下面的内容来自服务器,我在文本区域下显示附加tinymceJavascript Tinymce未正确显示html?,javascript,struts2,tinymce,wysiwyg,Javascript,Struts2,Tinymce,Wysiwyg,我有下面的内容来自服务器,我在文本区域下显示附加tinymce <p>Test1</p> <p>Test2</p> 我在浏览器中看到以下p标记 <p>Test1</p> <p>Test2</p> 我不确定我在这里错过了什么?我在firebug控制台中没有看到任何错误。当我从firebug检查我的文本区域时, it textarea正确
<p>Test1</p>
<p>Test2</p>
我在浏览器中看到以下p标记
<p>Test1</p> <p>Test2</p>
我不确定我在这里错过了什么?我在firebug控制台中没有看到任何错误。当我从firebug检查我的文本区域时,
it textarea正确地附加了tinymce,但不知何故没有以正确的格式显示html内容?我使用的是struts 2 textarea,即
以下是我的tinymce配置:-
function attachTinyMCE() {
tinyMCE.init({
mode: "textareas",
theme: "advanced",
plugins: "preview",
readonly: true,
theme_advanced_buttons1: "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,|,formatselect,fontselect,fontsizeselect,sub,sup,|,bold,italic,underline,strikethrough",
theme_advanced_buttons2: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_path: false,
theme_advanced_resizing: true,
entity_encoding: "raw"
});
}
更新:-如果我从服务器发送以下内容,即
<p>Test1</p>
<p>Test2</p>
它在tinymce i,e中正确显示
Test1
Test2
p
在编辑器的单元中被视为字符串。如果要将其作为标记进行评估,则需要将p
替换为我发现了问题。实际上是struts 2标记完成了html转义。在tinymce文本区域,我看到p>为。所以浏览器似乎在自动转换它。但问题是,不知何故,tinymce将视为字符串而不是html标记。请看我的更新也。
<p>Test1</p>
<p>Test2</p>
Test1
Test2