As you can see the return JSON from a salesforce controller contains lots of escaped characters

' "

  "status" : "SUCCESS",
  "Name" : "Liz D'Cruz",

What's the normal way to handle this problem? I think to deal this problem case by case is not a smart way.

eg: STRING.replace(xxx, yyy)

  • Please edit your post to be more specific about the context involved here. You should be able to provide exact reproduction steps here. Are you doing some Visualforce remoting by chance?
    – Adrian Larson
    Commented Jan 19, 2017 at 23:46
  • Hi newBike. I linked a possible answer to your question that I found, but I didn't use the Duplicate Question feature because I wanted to give you a chance to respond, and your question would have been automatically closed. Please let us know if that gives you the information you were looking for.
    – sfdcfox
    Commented Jan 19, 2017 at 23:58
  • @sfdcfox I think you gave me the fix. should I close this thread myself?
    – newBike
    Commented Jan 20, 2017 at 0:12
  • @newBike I can close it so that future visitors will also have a direct link to the answer. Glad I could help!
    – sfdcfox
    Commented Jan 20, 2017 at 0:13


Browse other questions tagged .