title: jQuery looping .each() JSON key/value not working
body: <p>I am having problems in looping the key/value of JSON by jQuery .each() function</p>
  
  <p>Initially I have a JSON like this:</p>
  
  <pre><code>json = {"aaa":[
                {"id":"1","data":"aaa1data"}
                ,{"id":"2","data":"aaa2data"}
                ],
          "bbb":[
                {"id":"3","data":"bbb1data"}
                ]
         }
  </code></pre>
  
  <p>And I would like to loop through all the key/value elements inside the JSON (aaa and bbb) and the retrieve the inner JSON arrays for looping again, so I tried</p>
  
  <pre><code>$(json).each(function(index,data)
  {
      var zzz = data;
      $(zzz).each(function(index,data))
      {
         //some other stuff
      }
  }
  </code></pre>
  
  <p>However, I discovered that the first .each() function will regard the whole json as a single structure and will not loop on its element's key.The data parameter received from the .each() function is always the original json itself. I can never get the reference that pointing to the inner JSON array of aaa and bbb.</p>
  
  <p>What would be the problem here and how should I loop for all the key/value elements in a JSON by jQuery properly?</p>