ajax提交form表单,后台接收不到值

$.ajax({
    url: "",
    type: "post",
    data: formData,
    dataType: "json",
    contentType: false,  // 告诉jQuery不要去设置Content-Type请求头
    processData: false,
    success: function (data) {

必须要有,设置发送给服务器的格式

在 ajax 中 contentType 设置为 false 是为了避免 JQuery 对其操作,从而失去分界符,而使服务器不能正常解析文件。

猜你喜欢

转载自blog.csdn.net/banjw_129/article/details/80585990