如何使用jquery方法post发送tinymce内容

如何使用jquery方法post发送tinymce内容,jquery,post,serialization,tinymce,html-entities,Jquery,Post,Serialization,Tinymce,Html Entities,我有一张表格 像这样 <form id=form ><input type='text' name='input1' ><textarea name='text' ></textarea></form> $.ajax({ url: "action.php", data: $dados, type: 'POST', time

我有一张表格

像这样

<form id=form ><input type='text' name='input1'  ><textarea name='text' ></textarea></form>
       $.ajax({
            url: "action.php",
            data:  $dados,
            type: 'POST',
            timeout: 6000,
            success: function (retorno) {

            }
        });
input1=value & input2 = val & ue 
我得到了所有的值,通过jquery post发送,如下所示

       $.ajax({
            url: "action.php",
            data:  $dados,
            type: 'POST',
            timeout: 6000,
            success: function (retorno) {

            }
        });
input1=value & input2 = val & ue 
问题的开始是,我的textarea是一个TinyMCE,我使用它获取val

 $("#form").find('textarea').each(function(){
        $dados = $dados + "&" + $(this).attr('name') + "=" +  tinyMCE.get( $(this).attr('id') ).getContent();

    });
我的可变$dados是这样的

field=value & filed2 = value ....
现在问题来了

当我把这样的文字

       $.ajax({
            url: "action.php",
            data:  $dados,
            type: 'POST',
            timeout: 6000,
            success: function (retorno) {

            }
        });
input1=value & input2 = val & ue 
“Olámundão”

我的TinyeMCE的价值是(显示的空间)Olá;Mundã;o

该值是具有HTML实体的值

因此,我在tinyMCE值中有一个特殊的字符“&”

我的可变$dados变成了这样

       $.ajax({
            url: "action.php",
            data:  $dados,
            type: 'POST',
            timeout: 6000,
            success: function (retorno) {

            }
        });
input1=value & input2 = val & ue 
这个特殊的字符弄乱了我的tinyMCE值


有人可以帮我吗?

为什么不使用类似的方法来生成$dados对象? 无需将数据构建为html ajax GET参数字符串

var $dados = {};
$("#form").find('textarea').each(function(){
    $dados[$(this).attr('name')] = tinyMCE.get($(this).attr('id')).getContent();
});
你能试试这个吗