javascript - 使用ajax将数据从TinyMCE保存到php

标签 javascript php jquery html ajax

我在我的应用程序中使用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/

相关文章:

php - 来自数据库的动态样条 Highcharts

javascript - 如何从 for...of 循环返回值?

javascript - 获取倒数第二个斜杠的值

php - exec() 超时

javascript - 如何在图像悬停中显示文本

javascript - jQuery 根据相关复选框选择求和单元格

php - 使用 mysql 在矩形或圆中查找点

php - 获取引用对象的数据

c# - 从 C# 后面的 ASP.NET 代码调用 jQuery 函数

jquery - 将 div 及其关联元素转换为 canvas jquery?