I\'m outputting values from a database (it isn\'t really open to public entry, but it is open to entry by a user at the company -- meaning, I\'m not worried about XSS).
You need to escape quotes with double backslashes.
This fails (produced by PHP's json_encode):
This works: