I am returning a JSON key/value pair from a webservice.
The problem is that the value is being returned as a string, and I can't work out how to get javascript to read the values.
ie, I essentially need the following:
var myData = { "First": "foo", "Second": "bar" };
but my webservice is actually returning:
var myData = '{ "First": "foo", "Second": "bar" }';
(notice the quotes - the { and } are part of the string).
How do I get the first and second values from this? I guess I can do some hacky string manipulation stuff to build the object myself, but i'm thinking there should be a better way. I don't really understand why its having such a problem, I've used similar stuff before without ever having come across this.
thanks
...
Go to the complete details ...