I need to pass in a javascript array into jquery but my code is only returning [object object]
$( "#enviar" ).click(function() {
var data = {};
var i = 0;
var u = -1;
$.each($('.ui'), function() {
data[i] = this.value;
i++;
});
console.log(data);
$.ajax({
type: "POST",
url: "send_car.php",
data: "photo="+data+"&u="+u,
success: function(data){
}//end success
})//end ajax submit*/
});
console log is showing the array
Object {0="d-170", 1="d-171"}
but the data is being pass as [object object]
ui class is a hidden input with the same name and different values.
I have read various post and tried with serialize but I get the same results.