ajax post not sending data

后端 未结 2 510
我在风中等你
我在风中等你 2021-01-25 08:54

UPDATE: I Figured it out. Was a URL issue, which redirected and cleared the POST before it was sent to the server.

$(\'#addbtn\').on(\'click\',function() {

$.a         


        
2条回答
  •  花落未央
    2021-01-25 09:39

    Try adding contentType to application/x-www-form-urlencoded

    $.ajax({
      type: "POST",
      url: "/create/",
      dataType: "json",
      data: $('#MultiAdd').serializeArray(),
      contentType: "application/x-www-form-urlencoded",
      success: function (data) { //success },
      error: function (xhr, ajaxOptions, thrownError) { //some sort of error }
     });
    

提交回复
热议问题