<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(); } // recurse arrayまたはobject 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 + '":') +文字列(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}]、 "_class":4}] "_value" : "0.0", "_class" : 4 }], "TSP.IBR.INFO" : [{ "_value" : "0.0", "_class" : 4 }] } }, "isCanceled" : false, "e" : "", "isResponsed" : true, "aoqSize" : 0, "isAsyncPost" : false, "code" : 0、 "requid": "xxxx-xxxxxxx-xxxxx-6c2f17bb-ea18-42ec-98fa-3f63b8d26aba-nd-rq"、 "バージョン": "1.0"、 "fname": "tsp. "nodetime":1362462128706、 "iskeycompressed":false、 "seq":2} alert(obj2string(obj))</script>