jQuery, Quotes, characters etc are breaking my JSON
- by nobosh
I'm using json2.js to create a JSON object which JQUERY posts to the Server. The object looks like:
[{"locationID":"16","locationDesc":"XXXX"}, {"locationID":"111","locationDesc":"XXXX"}, {"locationID":"12","locationDesc":"XXXX"}, {"locationID":"11","locationDesc":"XXXX"}]
Problem here is that XXXX sometimes contains quotes like "we're'" etc.... How should I handle this? Do you I escape somewhere or encode in some way?
Thanks