TinyMCE 中的示例数据:
✓ 和 ☺ ✏ ✂
(以上HTML代码:<p>✓ and ☺ ✏ ✂</p>
)
之前:(工作正常,在保存的文档中获得相同的字符)
function save_and_submit() {
var tinyGenData = tinyMCE.get('webisoData').getContent();
var tinyGenDataShow = tinyMCE.activeEditor.getContent();
opener.document.online_edit.command.value =
'save_online_edited_data';
opener.document.online_edit.online_edited_data.value = tinyGenData;
opener.document.online_edit.submit();
setTimeout(saveMessageDelay,1000);
}
之后:(在保存的文档中出现意外字符)
function save_and_submit() {
var content = tinyMCE.get('webisoData').getContent();
jQuery.post("myscript1.pl",{
online_edited_data: content,
}).done(function (data) {
var content_img = data;
console.log(content_img);
...
...
do some more work, call 1 more script, then save the document
...
});
Console.log
输出显示了上述字符的一些奇怪的 HTML,即
<p>✓ and ☺ ✠✂</p>
所以变化是我调用了一个脚本来进行一些额外的工作。我猜这与jQuery.post
这正在改变上面的特殊字符。
知道这背后的原因是什么以及如何阻止它更改特殊字符的 HTML?
PS:如果我使用entity_encoding: numeric
在 TinyMCE 中一切正常。但我不明白为什么它工作得很好Before
那么版本呢?那里我没有任何entity_encoding
但一切仍然正常。所以我认为这与 jQuery 的 POST 有关。