asp.net mvc - SyntaxError: JSON.parse: expected ',' or '}' after property value in object -
i got error when convert json string javascript object. json string contains double quotes {"name":"dem"o"} proper way handle double quotes when parse json string?
the json string contains double quotes {"name":"dem"o"}
that's invalid json. cannot parse it. if want able parse string json parser need have valid json in first place. make sure have valid json:
{"name":"dem\"o"} to ensure never end such broken strings, never build them manually - always use json serializer when creating json string. handle , escape values.
Comments
Post a Comment