I have a SignalR client application that receives a Json serialized list of objects. When I run the following script on the incoming data:
connection.received(function (data) {
$.each(divIds, function (index, id) {
$.each(data, function (index2, object) {
updateCell(object.property1);
updateCell(object.property2);
});
});
});
alert() tells me that $.each iterates over each character in the incoming data as a string, instead of the data being treated as a list of objects.
The incoming data is:
[{"property1":"value1","property2":41.3},{"property1":"value2","property2":43.2},{"property1":"value3","property2":559.1}]
The data is created on the server with this:
string output = JsonConvert.SerializeObject(list, Formatting.None).Trim();
What am I doing wrong?