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


Save Data fromTinyMCE to php using ajax

我在应用程序中使用TinyMCE

我想使用 ajax 将 TinyMCE 中输入的数据保存到 php

在发送到 ajax 之前,我尝试使用tinyMCE.triggerSave()但是当添加一些表情符号 | 图像时,我会得到输出,[img] link for image [/img]完成这个 html regnosie 这种类型的编码时在浏览器中输出为 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标签)。