title: "filter" json through ajax (jquery)
body: <p>I'm trying to filter the json array through ajax and not sure how to do so.</p>
  
  <pre><code>{
    posts: [{
      "image": "images/bbtv.jpg",
      "group": "a"
    }, {
      "image": "images/grow.jpg",
      "group": "b"
    }, {
      "image": "images/tabs.jpg",
      "group": "a"
    }, {
      "image": "images/bia.jpg",
      "group": "b"
    }]
  }
  </code></pre>
  
  <p>i want it so that i can only show items in group A or group B.</p>
  
  <p>how would i have to change my ajax to filter through the content?</p>
  
  <pre><code>$.ajax({
   type: "GET",
   url: "category/all.js",
   dataType: "json",
   cache: false,
   contentType: "application/json",
   success: function(data) {
  $('#folio').html("&lt;ul/&gt;");
  $.each(data.posts, function(i,post){
     $('#folio ul').append('&lt;li&gt;&lt;div class="boxgrid captionfull"&gt;&lt;img src="' + post.image + '" /&gt;&lt;/div&gt;&lt;/li&gt;');
  });
  
  initBinding();
   },
   error: function(xhr, status, error) {
     alert(xhr.status);
   }
  </code></pre>
  
  <p>});</p>
  
  <p>Also, how can I can I make each link process the filter?</p>
  
  <pre><code>&lt;a href="category/all.js"&gt;Group A&lt;/a&gt; &lt;a href="category/all.js"&gt;Group B&lt;/a&gt;
  </code></pre>
  
  <p>Sorry for all these questions, can't seem to find a solution..
  Any help in the right direction would be appreciated.</p>
  
  <p>Thanks!</p>