I need to send php string to javascript. I use json_decode.
var mystring = '<?php echo json_encode($phpstring)?>';
What would be a proper way to output this string in javascript?
jQuery.parseJSON(mystring)
shows error Uncaught SyntaxError: Unexpected token. I don't understand why. Isn't json_encode supposed to put a string into a proper json obj?