Trying to get SignalR JSON object (complex object) over to client. The client is receving it and when looking at the network analyzer in IE, the format looks correct and the data is there, but I am unable to actually get at the data in the client. I tried using the JQuery JSON parsng and now I'm trying to get JSON.parse to work.
Here is my code in the client:
// Build connection to hub and wire it up
var subscriber = $.connection.subscriberHub;
subscriber.getMessage = function (data) {
alert("Message Recieved: " + data);
var parsedObject = JSON.parse(data);
alert("Object parsed");
alert(parsedObject.Site);
alert("Passed everything without error");
};
$.connection.hub.url = "http://localhost:8083/signalr";
$.connection.hub.start();
});
Server I am just doing a Clients.getMessage(signalRObject).
When I get data, the first alert shows data as [object Object], so I think I am good up to the point of parsing the JSON object.
Can someone tell me the proper way to get at the data.