title: How to loop through this JSON array on jQuery?
body: <p>I have a two dimensional JSON array returned from a PHP script via a jQuery AJAX call. I have been browsing around trying to find out how to loop through each of the rows and display each entry within a div but I am very confused and unsure on how to do it in this particular case. </p>
  
  <p>Here is an example of a JSON returned by the server:</p>
  
  <pre><code>{"location_id":"505","location_name":"University of the Arts London","location_type":"uni","location_num_listings":"22","location_num_users":"187","relevancy":"2"},
      {"location_id":"592","location_name":"London South Bank University","location_type":"uni","location_num_listings":"1","location_num_users":"1","relevancy":"2"},
      {"location_id":"591","location_name":"London Metropolitan University","location_type":"uni","location_num_listings":"47","location_num_users":"185","relevancy":"2"},
      {"location_id":"590","location_name":"University College London","location_type":"uni","location_num_listings":"29","location_num_users":"176","relevancy":"2"},
      {"location_id":"586","location_name":"St George's, University of London","location_type":"uni","location_num_listings":"9","location_num_users":"4","relevancy":"2"},
  </code></pre>
  
  <p>Here is my script so far:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $("#directory_search_input").keyup(function() {
          $("#directory_search_results").html('');
          var regionvalue = $(this).val();
          var jsonresult;
          var url = '&lt;?php echo site_url('ajax/ajax_default/directory_search')?&gt;';
          $.post(url,{input_val:regionvalue}, function(data) {
              var results = jQuery.parseJSON(data);
              $.each(results, function() {
                  $.each(this, function(index, value) {
                      $("#directory_search_results").append(/*Append a new div for each row returned*/);
                  });
              }); });
  </code></pre>
  
  <p>Example desired output:</p>
  
  <p>Location ID: 505,
  Location Name: University of the Arts London</p>
  
  <p>Location ID: 592,
  Location Name: London South Bank University </p>
  
  <p>etc etc</p>