Technique to avoid this parse error? JSON +double quote

javascript, jquery, json

Solution

You can use `backslash` to escape the double qoute, read more about escape character over here.

Change

“my country is “uk” ”

To

“my country is \“uk\” ”

Problem

We know in JSON string object we have property and its value as “Property”:”Value” Suppose my Value contains a double quote, Like “Property”: “my country is “uk” ” We know that this is going to give parse error on JSON.parse(). What is the technique to avoid this parse error?

Original source