I would like to use JSON to send several variables, such as status, error message and contents, to the Javascript function via Ajax.
The problem I am facing is that I am retrieving the contents from the database, and almost all the data that is sent back to the browser is multi-line. And because of this, it seems that my JSON is not confirmed.
An outout example could be:
{ "status" : "ok", "message" : "All is well", "contents" : "Lorem Ipsum Dolor sit amet" }
Is there any special way to handle a multi-line line that I missed, or is it just not possible (seems unlikely)?
Thanks!
source share