I am storing JSON objects retreived from web service to objects in javascript. In many places this gets stringified(This obj goes through some plugins and it strigifies and
What did you expect to happen?
JSON.stringify
does not act like an "identity" function when called on data that has already been converted to JSON. By design, it will escape quote marks, backslashes, etc.
You need to call JSON.parse()
exactly as many times as you called JSON.stringify()
to get back the same object you put in.
You can avoid that simply by calling JSON.stringify() exactly once on the data you want turn into JSON.
Try
JSON.stringify(s).replace(/\\"/g, '"')