[{"tag":35,"value":"W","children":[
{"tag":55,"value":"GOOG","children":null},
{"tag":262,"value":"ghost332002m0","children":null},
{"tag":268,"value":"1","children":[
{"tag":269,"value":"B","children":null},
{"tag":271,"value":"0","children":null},
{"tag":336,"value":"3","children":null}
]}
]},
{"tag":35,"value":"W","children":[
{"tag":55,"value":"GOOG","children":null},
{"tag":262,"value":"ghost332002m0","children":null},
{"tag":268,"value":"0","children":null}
]}
]
JSONがあり、それはFIX Market Dataであり、これらのネストされたグループがあるので、これはJSONでのこれらのFIXメッセージの私の表現です。とにかく、私はそれを私のWebクライアントに送信し、ディスプレイに戻す必要があります。
$.getJSON('/receive', function(data, returnValue) {
$.each(data, function(index,value) {
$('#output').append('<p>');
appendStuff(value);
$('#output').append('</p>');
});
function appendStuff(children) {
debug_var.push(children);
$.each(children, function(child) {
$('#output').append(child.tag+'='+child.value+' ');
if (child.children != null) {
appendStuff(child.children);
}
})
}
私は再帰を使用してこのデータをスピンし、すべてを印刷しようとしています。私が得るものは:
undefined=undefined undefined=undefined undefined=undefined
私は何が間違っているのですか?
ああ、データはすべてdebug_varにあります...