I was wondering if it is possible to transfer data stored in a javascript array to the server using the jQuery ajax function.
The jQuery documentation states:
$.ajax({ type: 'POST', url: url, data: data, success: success, dataType: dataType });
Is it possible to set "data" to an array? How would this work be done, it seems that the data expects a pair of key values? I am currently just hardcoded values, but I want this to be a more dynamic approach. My current code is:
jQuery.ajax({ url: "/createtrips/updateitin", type: 'POST', data: {place1: 'Sydney', place2: 'London'}, dataType: 'json', });
Rowan
source share