简体   繁体   中英

Save Data fromTinyMCE to php using ajax

I am using TinyMCE in my application

i want to save the data entered in TinyMCE using ajax to php

I have tried using tinyMCE.triggerSave() before send to ajax but when some emoticons | images are added i get the out put as [img] link for image [/img] done this html regnosie this type of coding when output as html in browser ?

how i can save the data as a html to db

My Script

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标签)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM