HTML as JSON attribute via AJAX
Hey all, first post.
I'm trying to using ajax to fetch a JSON object via PHP. When I construct the object in the PHP script I create an attribute called "content", and in that attribute is some html... only of course when I try to parse the JSON response on the client side, I get syntax errors.
I've stripped out all \n and \r characters and used addslashes() to escape the quotes, yet still get syntax errors. What am I missing?
Or alternatively, is there a better way to return presentation content through ajax and parse it into html on the client side?
Remarkably, google is not my friend in this instance... any help much appreciated.
EDIT: whoops, looks like I might have posted this in the wrong section. Any mod feel free to move if appropriate.
Last edited by dangerdaveCS; 03-13-2009 at 07:59 PM..