Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PHP$\u POST不使用jquery_Javascript_Php_Jquery - Fatal编程技术网

Javascript PHP$\u POST不使用jquery

Javascript PHP$\u POST不使用jquery,javascript,php,jquery,Javascript,Php,Jquery,我正在使用以下jquery代码: <script type="text/javascript"> $(document).ready(function () { $("#message").hide(); $("#please_wait_box").hide(); $("#editcustomer").submit(function (e) { $("#message").hide(); $("#please_wait_box"

我正在使用以下jquery代码:

<script type="text/javascript">
$(document).ready(function () {
    $("#message").hide();
    $("#please_wait_box").hide();
    $("#editcustomer").submit(function (e) {
        $("#message").hide();
        $("#please_wait_box").show();
        e.preventDefault();
        dataString = $("#editcustomer").serialize();
        $.ajax({
            type: "POST",
            url: "editcustomer_go.php",
            cache: false,
            data: dataString,
            success: function (res) {
                $("#please_wait_box").hide();
                $("#message").html(res);
                $('#message').fadeIn('slow');
                if (res.indexOf("success") != -1) {
                    window.location.href = res.substr(8);
                }
            }
        });
    });
});
</script>
我使用tinymce作为文本编辑器-它工作正常,但是当数据在PHP中发布时,它在tinymce文本编辑器中看不到更改的数据-它必须是纯文本


我该如何解决这个问题?

要从TinyMCE获取数据,需要使用其getContent()函数

所以对你来说应该是

// Grab a reference to the editor
var ed = tinyMCE.get('tinymceeditorname');
// Get it's content
var editordata= ed.getContent();

。。。然后将editordata与表单的其余部分一起作为AJAX调用数据传递。

您能解释一下吗
在tinymce文本编辑器中看不到更改的数据-它必须是纯文本。
?对于较小的内容,如邮件,您可以使用$\u POST。如果它越来越重,最好使用$DHL。这个问题的标题让我困惑。
$\u POST
是如何失败的?如果我回显$\u POST[“站点信息注释”];这是textarea名称,它显示的是旧数据,而不是我在textarea中输入的新数据。您可以在
$(“#editcustomer”).submit()函数中添加这两行。然后需要将editordata与从表单序列化的其他数据一起传递给AJAX调用。
// Grab a reference to the editor
var ed = tinyMCE.get('tinymceeditorname');
// Get it's content
var editordata= ed.getContent();