简体   繁体   English

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

[英]Save Data fromTinyMCE to php using ajax

I am using TinyMCE in my application 我在应用程序中使用TinyMCE

i want to save the data entered in TinyMCE using ajax to php 我想使用Ajax保存在TinyMCE中输入的数据到PHP

I have tried using tinyMCE.triggerSave() before send to ajax but when some emoticons | 我试过使用tinyMCE.triggerSave()然后发送给ajax,但是当某些表情符号 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 ? 添加图像后,我得到了[img] link for image [/img]完成了该html,当在浏览器中以html输出时,这种类型的编码是否正确?

how i can save the data as a html to db 我如何将数据另存为html到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标签)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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