title: jquery $.each() for objects
body: <pre><code>&lt;script&gt;
      $(document).ready(function() {
          var data = { "programs": [ { "name":"zonealarm", "price":"500" }, { "name":"kaspersky", "price":"200" } ] };
          $.each(data.programs[0], function(key,val) {
              alert(key+val);
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>This code retrieves the first data. <code>name:zonealarm</code> and <code>price:500</code>. </p>
  
  <p><strong>How can I retrieve all the data in the object?</strong></p>
  
  <p>I tried <code>$.each(data.programs, function(key,val)</code> but it didn't work. </p>
  
  <p>Should I put it in a loop?</p>