×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
0
Language: Javascript
Posted by: Aleksandr Trofimov
Added: Aug 20, 2012 9:26 PM
Modified: Aug 20, 2012 9:30 PM
Views: 33
Tags: no tags
  1. function json_pretty(json) {
  2.     var jsonString = JSON.stringify(json, null, '_JS_');
  3.     jsonString = jsonString.replace(/\n/g, '<br/>');
  4.     jsonString = jsonString.replace(/_JS_/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
  5.     return jsonString
  6. }
Comments disabled