How do I POST an array of objects with $.ajax (jQuery or Zepto)

后端 未结 5 1550
旧时难觅i
旧时难觅i 2020-12-01 01:56

I\'d like to POST an array of objects with $.ajax in Zepto or Jquery. Both exhibit the same odd error, but I can\'t find what I\'m doing wrong.

The data saves to the

5条回答
  •  长情又很酷
    2020-12-01 02:19

    Try the following:

    $.ajax({
      url: _saveDeviceUrl
    , type: 'POST'
    , contentType: 'application/json'
    , dataType: 'json'
    , data: {'myArray': postData}
    , success: _madeSave.bind(this)
    //, processData: false //Doesn't help
    });
    

提交回复
热议问题