JSON and escape characters
Hi, I'm already stuck.
Have been trying for several hours to understand this, but I just can't get into this JQuery/Json world.
Here's my problem.
I've create a WCF REST service wich returns JSON.
The service returns HTML, so the plan is to just load the response directly into the HTML DOM.
Here is the response sent from the REST Service:
-
"<li xmlns:ddwrt='http:\/\/schemas.microsoft.com\/WebParts\/v2\/DataView\/runtime'><div class=\"image
\"><a href=\"http:\/\/moss1:10000\/News\/Corporate - English\/CEOCorner\/Pages\/BreakingNews1.aspx\"
target=\"\" title=\"\" rel=\"lyteframe\" rev=\"width: 820px; height: 500px;\"><img src=\"\/_controltemplates
\/DFDS\/ImageResizer.aspx?ImageURL=\/News\/PublishingImages\/123.jpg&Width=80&Height
=0\"\/><\/a><\/div><span>januar 06, 2009<\/span><h4><a href=\"www.msn.com\" rel=\"lyteframe\" rev=\"width
: 820px; height: 500px;\">Breaking News1<\/a><\/h4><p>bla bla bla1111<\/p><span style=\"font-size:10px
;font-style:italic;\"><\/span><\/li>"
As you can see the response contains a lot of escaping characters \ (backslash characters) - is that normal for javascript ?
Anyhow the question is - how do I "decode" this string so I can put the HTML into the HTML DOM
I've tried the various JQuery ajax commands like .getJSON, .load, .Ajax() etc - but they all return the escaped response to me - and I don't know how to handle this escaped response.
regards
Lars