title: Parse Nested JSON using jquery & Ajax
body: <p>found a code snippet i am trying to modify but i can't seem to get it to work, This code is made to parse the json format as such</p>
  
  <pre><code>[
    {
      "name":"Barot Bellingham",
      "shortname":"Barot_Bellingham",
      "reknown":"Royal Academy of Painting and Sculpture",
      "bio":"Barot has just finished his final year at The Royal Academy of Painting and Sculpture, where he excelled in glass etching paintings and portraiture. Hailed as one of the most diverse artists of his generation, Barot is equally as skilled with watercolors as he is with oils, and is just as well-balanced in different subject areas. Barot's collection entitled \"The Un-Collection\" will adorn the walls of Gilbert Hall, depicting his range of skills and sensibilities - all of them, uniquely Barot, yet undeniably different"
    }
  ]
  </code></pre>
  
  <p>and my json format is multilevel nested such as</p>
  
  <pre><code>{
      "data": [
          {
              "artists": {
                  "Artist": "Muse"
              }
          },
          {
              "artists": {
                  "Artist": "Coldplay"
              }
          }
      ]
  }
  </code></pre>
  
  <p>The Javascript i found is</p>
  
  <pre><code>$('#search').keyup(function(){
      var searchField = $('#search').val();
      var myExp = new RegExp(searchField, 'i');
      $.getJSON('data.json', function(data){
          var output = '&lt;ul class="searchresult"&gt;';
          $.each(data, function(key, val){
              if((val.name.search(myExp) != -1) || (val.bio.search(myExp) != -1)) {
                  output +='&lt;li&gt;';
                  output +='&lt;h2&gt;' + val.name + '&lt;/h2&gt;';
                  output +='&lt;img src="images/' + val.shortname + '_tn.jpg" alt="'+ val.name +'" /&gt;';
                  output +='&lt;p&gt;' + val.bio + '&lt;/p&gt;';
                  output +='&lt;/li&gt;';
              }
          });
          output += '&lt;/ul&gt;';
          $('#update').html(output);
      });
  });
  </code></pre>
  
  <p>So how and where would i modify this to sort through my json format?</p>
  
  <p>Thanks!</p>