title: simple jquery loop through JSON array?
body: <p>i have this simple jquery script to loop through JSON array <br>
  the script is not working at it all and never give output.<br>
  im sure that the JSON array is valid but i don't know why Jquery not parsing it .<br></p>
  
  <pre><code>$(document).ready(function(){
      var cost = [{"gold":"100","iron":"80","wood":"120","food":"70"},{"gold":"80","iron":"60","wood":"90","food":"35"}];
      var costarr = $.parseJSON(cost);
      $.each(costarr, function(i, item) {
         alert(item.gold);
      }
  });
  </code></pre>