jquery sending form data and a json object in an ajax call
问题 I'm making a call to another ajax page, the call posts a json object. I also need to send data from a form (not using submit - I have the ajax call attached to a button which uses e.preventDeault() ). The call is as folows: var myUrl = 'sendswatch-data.php'; $.ajax({ url: myUrl, data: {'swatchid[]':swatchArray}, 'formdata':$('#orderData').serialize()}, type: "POST", error: function(xhr, statusText, errorThrown){ // Work out what the error was and display the appropriate message }, success: