Sabtu, 24 Oktober 2015

How To Add Random Posts Widget to Blogger

How To Add Random Posts Widget to Blogger - First announced in March 2017, the Xperia L1 has come to replace Sony’s now discontinued E series. Priced at a surprisingly cheap £169, the L1 is Sony’s newest attempt at shaking up the budget phone market. Its large screen and sleek design make us think of Sony’s higher range of smartphones: it would be hard to single it out as the cheapest model in a line of Xperias. But at such a bargain price, we can’t expect it to perform as well as its more expensive counterparts. So how does the L1 hold up to other low-budget smartphones? Here’s our Xperia L1 review. first time the View branding, well we have collected a lot of data from the field directly and from many other blogs so very complete his discussion here about How To Add Random Posts Widget to Blogger, on this blog we also have to provide the latest automotive information from all the brands associated with the automobile. ok please continue reading:

Follow the easy steps below to add Random Posts Widget to your blog.

1.Log in to your dashboard--> layout- ->Page Elements

2.Click on Add a Gadget on the sidebar.

3.Select HTML/Javascript and add the javascript code given below and click save.

<div id="myLuckyPost"></div> 
<script type="text/javascript"> function showLucky(root){ var feed = root.feed; var entries = feed.entry || []; var entry = feed.entry[0]; for (var j = 0; j < entry.link.length; ++j){if (entry.link[j].rel == 'alternate'){window.location = entry.link[j].href;}}} function fetchLuck(luck){ script = document.createElement('script'); script.src = '/feeds/posts/summary?start-index='+luck+'&max-results=1&alt=json-in-script&callback=showLucky'; script.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(script); } function feelingLucky(root){ var feed = root.feed; var total = parseInt(feed.openSearch$totalResults.$t,10); var luckyNumber = Math.floor(Math.random()*total);luckyNumber++; a = document.createElement('a'); a.href = '#random'; a.rel = luckyNumber; a.onclick = function(){fetchLuck(this.rel);}; a.innerHTML = 'Are ya feeling lucky, punk?'; document.getElementById('myLuckyPost').appendChild(a); } </script> 
<script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=feelingLucky"></script>

Tidak ada komentar:

Posting Komentar