title: how can I append this tree data using jquery recursively?
body: <pre><code>[{"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}
     ]} 
  ]
  </code></pre>
  
  <p>There's the JSON, it's FIX Market Data and you have these nested groups, so this is my representation of these FIX messages in JSON. Anyway, I send it to my web client and need to flatten it back out in the display. </p>
  
  <pre><code>$.getJSON('/receive', function(data, returnValue) {
      $.each(data, function(index,value) {
          $('#output').append('&lt;p&gt;');
          appendStuff(value);
          $('#output').append('&lt;/p&gt;');
      });
  function appendStuff(children) {
      debug_var.push(children);
      $.each(children, function(child) {
          $('#output').append(child.tag+'='+child.value+' ');
          if (child.children != null) {
              appendStuff(child.children);
          }
      })
  }
  </code></pre>
  
  <p>I'm trying to use recursion to spin through this data and print everything out. What I get is:</p>
  
  <pre><code>undefined=undefined undefined=undefined undefined=undefined
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Oh, the data is all there in debug_var...</p>
  
  <p><img src="https://i.stack.imgur.com/AAoZt.png" alt="enter image description here"></p>