Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/446.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/0/laravel/10.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 如何解决Ajax编辑器值post问题_Javascript_Php_Ajax - Fatal编程技术网

Javascript 如何解决Ajax编辑器值post问题

Javascript 如何解决Ajax编辑器值post问题,javascript,php,ajax,Javascript,Php,Ajax,我正试图用ajax发送一个CKeditor值帖子,但无论如何我都无法回复!我什么也找不到 function send_days(tourId){ var url = baseUrl + "tour/save_days/" + tourId; var value = CKEDITOR.instances.tour_textarea_days.getData(); $.ajax({ url: url, method:

我正试图用ajax发送一个CKeditor值帖子,但无论如何我都无法回复!我什么也找不到

function send_days(tourId){

    var url = baseUrl + "tour/save_days/" + tourId;
    var value = CKEDITOR.instances.tour_textarea_days.getData();

        $.ajax({
            url: url,
            method: "POST",
            data: dataString,
            contentType: false,
            processData: false,
            cache:false,
            success: function (data) {
                $('.tour_popup_container').html(data);
            }
        });
}

但当我偶然遇到像这样的ajax方法时。它成功了

 $.post(url, {data:value}, function (response) {
        $('.tour_popup_container').html(response);

    })

这是我的codeigniter php文件(实际上并不重要)


看起来您使用了dataString而不是value

var url = baseUrl + "tour/save_days/" + tourId;
    var value = CKEDITOR.instances.tour_textarea_days.getData();

        $.ajax({
            url: url,
            method: "POST",
            data: value /*dataString*/,
            contentType: false,
            processData: false,
            cache:false,
            success: function (data) {
                $('.tour_popup_container').html(data);
            }
        });

如果您使用的是php,只需将数据作为
表单提交
,并在另一端接收,就可以在php中获取其他变量并保存到数据库中时获取数据。
var url = baseUrl + "tour/save_days/" + tourId;
    var value = CKEDITOR.instances.tour_textarea_days.getData();

        $.ajax({
            url: url,
            method: "POST",
            data: value /*dataString*/,
            contentType: false,
            processData: false,
            cache:false,
            success: function (data) {
                $('.tour_popup_container').html(data);
            }
        });