开发者

Invalid JSON data

I have the following jquery which is invalid:

{
    "id": 12,
    "heading": "heading goes here 3",
    "content": "<p><span style="color: #ff0000;">content</span> <u><strong>goes </strong></u><span style="color: #ffffff;"><span style="background-color: #ff0000;">here</span></span> 3.</p>"
}

I am generating this with asp.net (vb.net) from data stored in a database. I think I need to somehow escape the double quotes within the c开发者_JAVA技巧ontent section of the json data. How do I do this?


Use single quotes for the style attribute.


Nevermind, I figured it out

mystring.replace("""","\""")

replaces all " with \"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜