0

I had a problem where I was doing an jquery $get for a list of schools. I was using an RQLForeach droplet to retrieve the list and specified the output to be JSON, I would then take the returned JSON and use jQuery template to render out the result.

Problem I was seeing the following in the output King'swhich should've been King's School.

I used the {{html schoolName}} Which was supposed to take care of the decoding correctly. But it did not....

1 Answer 1

1

The solution to the problem.

Problem: Was that encoding and decoding was happening twice. First the json:object that gets output from the droplet was already escaping XML. So would therefore encode the & of the apostrophe. i.e. it was reaching client side as &amp#39; instead of '. Therefore the {{hmtl}} could not decode it correctly

Answer: set the <json:object escapeXml="false"> this meant that by the time it reaches client side it was in the correct format &#39; to be decoded by the jquery {{html }} tag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.