Passed object in post ajax

Passed object in post ajax

Hello. I'm trying to pass data.
var favorite = {};
favorite[videobody.id] =  item.statistics;

So, at the moment i receive similar object:


Object{}

1

Object { viewCount= "88" , more... }



When I passed data to ajax and result is empty or non-existing object.
$.ajax({
url: "/admin/songs/ajaxViewers",
type: "post",
data: {favorite:favorite},
success: function () {
// location.reload();
},
error: function () {
alert("PROBLEM");

}
});

How to rewrite to work?