title: How to loop through the attributes of a JSON obj?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3022358/how-to-loop-on-a-json-object">How to loop on a JSON object?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to find out how to loop through the attributes of a JSON obj. I can get the attributes by specifying the key (see below), but how do I just loop through all of them?</p>
  
  <pre><code>var jsonStr = '{"Items":[{"Title": "Title 1", "Description":"Description 1"}]}';
  
  var json_parsed = $.parseJSON(jsonStr);
  
  
  // Cycle through all list items
  $.each(json_parsed.Items, function(i, val) {
      var listItem = $(this);
  
      var title = listItem.attr('Title');
      var description = listItem.attr('Description');
  
      // Instead, loop through all attributes
  
  }
  </code></pre>