187
rated 0 times
[
192]
[
5]
/ answers: 1 / hits: 16318
/ 13 Years ago, mon, october 10, 2011, 12:00:00
I have a string in javascript:
var test = '{test:\-}'
When I try to parse this as JSON with the following:
JSON.parse(test)
or with:
$.parseJSON(test)
I get a SyntaxError of type unexpected_token_number.
This the value for the test
attribute is a user enterable field. How should I properly escape this field?
More From » json