Using the jquery plugin form, how to stop the html encoded json from being escaped

advertisements

I've got a setup where I use the JQuery Form plugin to submit my forms through ajax, returning a json object from the server (running django, using simplejson.dumps). The json returned is constructed as this:

status: [success/invalid/error] error: [errortext if any] html: [html-text to be inserted]

My problem is that when entering the success function of my ajax call, the html part of the json is escaped so that the results I get are of the type <strong>Hello<\strong>. I've doublechecked the json string produced by the server, it validates using json-lint and has unescaped html-entities. Any suggestions on how I stop JQuery from escaping my html?


Make sure you're using .html() to use that response and not .text(), which will escape it like you're talking about.