printing a json on wasnt easy. it looked messy and made your web page very bad looking. theres a simple solution to overcome this.
stringify your json and then put inside a html <pre> tag. you will be amazed of the outcome.
jsonBody in the below example is the json object you wanna print.
stringify your json and then put inside a html <pre> tag. you will be amazed of the outcome.
jsonBody in the below example is the json object you wanna print.
<pre>'+JSON.stringify(JSON.parse(jsonBody), null, '\t')+'</pre>
Comments
Post a Comment