special characters - How to properly encode ATG commerce JSON taglib droplet response -
i had problem doing jquery $get list of schools. using rqlforeach droplet retrieve list , specified output json, take returned json , use jquery template render out result.
problem seeing following in output king's
which should've been king's school.
i used {{html schoolname}} supposed take care of decoding correctly. did not....
the solution problem.
problem: encoding , decoding happening twice. first json:object gets output droplet escaping xml. therefore encode & of apostrophe. i.e. reaching client side '
instead of '
. therefore {{hmtl}} not decode correctly
answer: set <json:object escapexml="false">
meant time reaches client side in correct format '
decoded jquery {{html }} tag.
Comments
Post a Comment