Random Post Dengan Gambar Dan Teks

Ini adalah cara mudah bagaiamana nak buat random post bergambar atau sekadar teks sahaja.



Random post teks, Copy code dibawah ini

<script type="text/javascript"> var numberOfPostsToShow12=10; </script> <div><ul id="randomPostsElmt12"></ul></div> <div style="font-size:80%;text-align:right"><a href="http://malaysiatopbloggers.blogspot.com/2012/01/random-post-dengan-gambar-dan-teks.html">Random post</a></div> <script type="text/javascript"> function addOnePost12(a){var c=document.getElementById("randomPostsElmt12");if(c){a=a.feed;if(a.entry.length>0)for(var b=a.entry[0],d=0;d<b.link.length;d++)if(b.link[d].rel=="alternate"){a=b.link[d].href;b=b.link[d].title;if(a&&a.length>0&&b&&b.length>0)c.innerHTML+="<li><a href="+a+">"+b+"</a></li>";break}}} function fetchOnePost12(a){a++;script=document.createElement("script");script.src="/feeds/posts/summary?start-index="+a+"&max-results=1&alt=json-in-script&callback=addOnePost12";script.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(script)} function randomPosts12(a){var c=parseInt(a.feed.openSearch$totalResults.$t,10);a=[];if(c<=numberOfPostsToShow12)for(var b=0;b<c;b++)a.push(b);else for(b=0;b<numberOfPostsToShow12;b++){var d=Math.floor(Math.random()*c),e;do{e=false;for(var f=0;f<a.length;f++)if(d==a[f]){e=true;d++;if(d>=c)d=0;break}}while(e);a.push(d)}for(c=0;c<a.length;c++)fetchOnePost12(a[c])}; </script> <script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=randomPosts12"> </script>


Atau anda mahu random post bergambar (with thumbnail) sila klick button dibawah.


Entertainment Space