<script type = "text/javascript">/*** Вывод любой объект JS как строка формата json* @param {object} _obj: объект, который должен быть вывод как строка*/var obj2string = function (_obj) {var t = typeof (_obj); if (t! = 'Object' || _obj === null) {// простой тип данных if (t == 'string') {_obj = '"' + _obj + '"' '; } return String (_OBJ); } else {if (_obj ancessionof date) {return _obj.tolocalestring (); } // Recurse Marray или объект 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}, "tsp. "_value": "0.0", "_class": 4}], "tsp.ibr.info": [{"_value": "0.0", "_class": 4}]}}, "isCancelled": false ":" "," isResponsed ": true," aoqsize ": 0,", ",", ",": ",", ",", ",", ",", ":", ",", ",", ",": ",": ",", ",", ":", ":", ":": ":": ",", ",", ":": ":": ",", ",", ":", ",", ",". : 0, "requid": "xxxx-xxxxxxxx-xxxxx-6c2f17bb-ea18-42ec-98fa-3f63b8d26aba-nd-R "Nodetime": 1362462128706, "iskeyCompressed": false, "seq": 2} Alert (obj2string (OBJ)) </script>