<script type = "text/javaScript">/*** js 객체를 JSON 형식 문자열로 출력* @param {object} _obj : string*/var obj2string = function (_obj) {var t = typeof (_obj); if (t! = 'Object'|| _obj === null) {// 간단한 데이터 유형 if (t == 'string') {_obj = ' ""' + _obj + ' "'; } return string (_obj); } else {if (_obj instanceof date) {return _obj.tolocalestring (); } // 배열 또는 객체 var n, v, json = [], arr = (_obj && _obj.constructor == array); for (n in _obj) {v = _obj [n]; t = typeof (v); if (t == 'string') {v = ' "' ' + v +'" '; } else if (t == "object"&& v! == null) {v = this.obj2string (v); } json.push ((arr? '': '' + n + ' ":') + string (v)); } return (arr? '[': '{') + string (json) + (arr? '' ':'} '); }}; var obj = { "result": { "fs": { "tsp.ibr.mirror": [{ "_value": "1.0", "_class": 4}], "tsp.ibr.get_fnames": [{ "_value": "0.0", "_class": 4}] "_value": "0.0", "_class": 4}], "tsp.ibr.info": [{ "_ _value": "0.0", "_class": 4}]}}, "iscanceled": 거짓, "e": "", "true,": ": isaSyncfp": 0, isAsyncppe " "코드": "requid": "xxxx-xxxxxxxxxxxxxx-6c2f17bb-ea18-42ec-98fa-3f63b8d26aba-nd-rq", "버전": "1.0", "fname": "tsp.ibs" "다운", "노드 타임": 1362462128706, "iskeyCompressed": 거짓, "seq": 2} alert (obj2string (obj)) </script>