I'm upgrading an application that was using jQuery 1.3.2 to consume a WCF Data Service (a.k.a. ADO.NET Data Services, a.k.a. Astoria) to use the latest version of jQuery (1.4.2). My application is now failing, with JSON parsing errors, because jQuery 1.4 now uses stricter JSON parsing.
I've run the JSON returned by my data service through various JSON validators, and the problem seems to be related to single-quote escaping in URI strings. My JSON looks like the following:
{
"d" : {
"__metadata": {
"uri": "http://foo.com/Services/Foo.svc/Foos(guid\'g17a49d5-fd66-4b2d-bd5f-e6245ec3e268\')" } } }
(I've modified it to remove unnecessary information.)
The parsing error is with the '\' escaping of single-quotes. If I remove the escape character, the JSON parses cleanly.
Has anyone had this problem, and have a fix or a work-around?
Thanks.