jQuery, Quotes, characters etc are breaking my JSON
Posted
by nobosh
on Stack Overflow
See other posts from Stack Overflow
or by nobosh
Published on 2010-03-13T04:34:17Z
Indexed on
2010/03/13
4:37 UTC
Read the original article
Hit count: 257
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
© Stack Overflow or respective owner