1 字符串转json对象标签:格式化,JSON,js,var,json,str,字符串 From: https://blog.51cto.com/u_15862653/5828356
2 json对象转格式化的字符串
<html>
<head></head>
<body>
<input type="button" οnclick="aa()" />
<textarea rows="13" cols="220" id="t"></textarea>
</body>
<script type="text/javascript">
function aa(){
var textarea=document.getElementById('t');
var str = '{"value":[{"NAME":"四","BIRTHDAY":"2018-10-03T11:33:50+08:00","AGE":"0","ID":"111111"}]}';
str = JSON.parse(str); 将json字符串格式化为json对象
textarea.value = JSON.stringify(str, null, "\t"); //再转成字符串
}
</script>
</html>