I’ve got a broken web service that I can’t access and alter. It sends down some mainly nice JSON, but one of the attributes is a nested JSON object that is being sent down as a string.
http://www.ireland.com/api/getitemweb/185213
CustomJsonData in the response from the above url is the example.
My question is how could I interpret the CustomJsonData string as an object?
I thought the ‘evil’ eval() might do it, but no luck.
Thanks,
Denis
If you are using eval, you need to add a ( and ) to the string before eval:
However, as you said, eval is evil, using parseJson from jquery is better (and extra parens not required):
Documentation for jQuery parseJSON: http://api.jquery.com/jQuery.parseJSON/