我在我的应用程序中使用TinyMCE
我想使用ajax将TinyMCE中输入的数据保存到php
我在发送到ajax之前尝试使用tinyMCE.triggerSave()
,但是当一些表情符号|添加图像后,我得到的输出为 [img] 图像链接 [/img]
完成此 html 在浏览器中以 html 形式输出时识别这种类型的编码?
如何将数据作为 html 保存到数据库
我的脚本
tinymce.init({
selector:'textarea#chat_message',
theme: "modern",
menubar: false,
width:900,
height:100,
statusbar: false,
plugins: [
"save advlist autolink lists link image charmap print preview anchor",
"searchreplace spellchecker visualblocks code fullscreen",
"insertdatetime media table contextmenu paste emoticons bbcode anchor lists"
],
toolbar:" save bold italic | bullist numlist outdent indent | autolink | link | image | lists | charmap | anchor | spellchecker | wordcount visualblocks | visualchars | table | directionality | emoticons | paste | spellchecker | bbcode | code |",
entity_encoding: 'raw'
});
最佳答案
$("#chat_message").html()
将为您提供实际内容(不剥离 html 标签)。
关于javascript - 使用ajax将数据从TinyMCE保存到php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22868837/