title: How to make this javascript, show random post by it's label?
body: <p>I have searching about random post and it's show Math.random() function, but because my lack of knowledge about javascripting so I need your help to make this javascript work on random, thanks.</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  //&lt;![CDATA[[
    function CompletedProject(json) {
      for (var i = 0; i &lt; json.feed.entry.length; i++) {
        var judulPost = json.feed.entry[i].title.$t;
        var thumbPost = json.feed.entry[i].media$thumbnail.url;
        //var linkPost = json.feed.entry[i].link[1].href;
        var linkPost;  
      // Get rel=alternate for truly post url
      for (var j=0; j &lt; json.feed.entry[i].link.length; j++)
      {
        if (json.feed.entry[i].link[j].rel == 'alternate')
        {
          linkPost = json.feed.entry[i].link[j].href;
          break;
        }
      }
  
        var showcompleted = '&lt;div class="ani-item"&gt;&lt;a href="'+linkPost+'"&gt;&lt;img alt="'+judulPost+'" class="shine" data-original="'+thumbPost+'"/&gt;&lt;h4&gt;'+judulPost+'&lt;/h4&gt;&lt;/a&gt;&lt;/div&gt;';
        document.write(showcompleted);
      }
    }
  //]]&gt;
  &lt;/script&gt;
  
    &lt;script src='/feeds/posts/default/-/Complete?alt=json-in-script&amp;amp;callback=CompletedProject'/&gt;
  </code></pre>