views:

50

answers:

1

My question is sort of stupid that why

JSON.stringify({"annotation": [{"x":1, "y":2}, {"x":1, "y":2}]})

does not return

{"annotation": [{"x": 1, "y": 2}, {"x": 1, "y": 2}]}

but returns

{"annotation":"[{\"x\": 1, \"y\": 2}, {\"x\": 1, \"y\": 2}]"}

and how can I get the first output?

+2  A: 

Are you using Prototype? This question may be related:

http://stackoverflow.com/questions/710586/json-stringify-bizarreness

Daniel Earwicker
Thanks, problem solved :)
Zifei Tong