用ajax把前台从表单获取到的变量值用php传给数据库哪里有问题?

用ajax把前台从表单获取到的变量值用php传给数据库哪里有问题?

问题描述:

img

img
img

报错截图看看

对比一下请求方式


$(document).on("click",'.heBtn1',function () {

    var data_id = $(".h_id").attr('data-id');

    $.ajax({
        type: 'post',
        url: globals.ajax_save_detail,
        data: {data_id : data_id},
        dataType: 'html',
        success: function(data){
            // callback(null,data);
            // $.hideLoading();
        },
        error: function(xhr, type){
            $.alert('请求失败!')
        }
    });
})

错误码500,这是你代码出问题了,开发者工具里查看网络,找到后端返回的这个请求,通过预览可以看到后端的错误信息