Data array for jQuery AJAX success

agille742

New Member
On server I am returning an array after some operations. I want to work with this array after successing of AJAX.\[code\]var addPaymentType = function(){ var data = http://stackoverflow.com/questions/3718368/new Object() data["function"] = "add"; data["payment_type_id"] = $("#payment_types").val(); data["data"] = $("#saveform").serializeArray(); $.ajax({ type: "POST", url: location.href, data: data, dataType: "JSON", success : function (data) { console.debug(data['plan_pt_id']); } });};\[/code\]But data['plan_pt_id'] is \[code\]undefined\[/code\]. If I return not an array, all works pretty. But how can I work with array?Thank you.
 
Back
Top