json_encode with double quotes passed into JSON.parse json_encode with double quotes passed into JSON.parse json json

json_encode with double quotes passed into JSON.parse


Since json can be used directly as an object literal in javascript, you could use it like this:

var decoded = <?php echo $jsonData ; ?>;

thus eliminating the need to do any further parsing to avoid issues with ' or \ characters within the text. the json_encode should already be taking care of " charaters.