title: Jquery - Select random JSON Object
body: <p>I have this jquery code to output the entries in a JSON file on page load...</p>
  
  <pre><code>$.getJSON('b.json', function(data) {
        $('#dictionary').empty().hide();
  
  
  
        $.each(data, function(entryIndex, entry) {
          var html = '&lt;div class="entry"&gt;';
          html += '&lt;h3 class="title"&gt;' + entry['title'] + '&lt;/h3&gt;';
          html += '&lt;div class="link_url"&gt;' + entry['link_url'] + '&lt;/div&gt;';
          html += '&lt;div class="image_src"&gt;';
          html += entry['image_src'];
          if (entry['quote']) {
            html += '&lt;div class="quote"&gt;';
            $.each(entry['quote'], function(lineIndex, line) {
              html += '&lt;div class="quote-line"&gt;' + line + '&lt;/div&gt;';
            });
            if (entry['author']) {
              html += '&lt;div class="quote-author"&gt;' + entry['author'] + '&lt;/div&gt;';
            }
            html += '&lt;/div&gt;';
          }
          html += '&lt;/div&gt;';
          html += '&lt;/div&gt;';
  
          $('#dictionary').append(html).fadeIn();
        });
      });
  </code></pre>
  
  <p>What I need to do is load one of these entries, randomly.</p>
  
  <p>Any advice appreciated.</p>
  
  <p>Many thanks,
  C</p>
  
  <p>The JSON file is...</p>
  
  <pre><code>[
    {
      "title": "WESITE NAME",
      "link_url": "http://www.website.com",
      "image_src": "http://www.website.com/images/recent.jpg",
    },
    {
      "title": "WESITE NAME",
      "link_url": "http://www.website.com",
      "image_src": "http://www.website.com/images/recent.jpg",
    },
    {
      "title": "WESITE NAME",
      "link_url": "http://www.website.com",
      "image_src": "http://www.website.com/images/recent.jpg",
    }
  ]
  </code></pre>