Home Blog Work

How To Create Blogger Post Index Page Using JavaScript

Published on January 12, 2013

Hi guys. How are you? Today I will explain you to create Posts Index page for your blogger blog. You many ask why we need it. The answers is simple. Just like Books index pages, its also a index page so that your blog reader easily go to the posts they like. In this we will print out the serial number, Post Title and Post link.



Note: Assuming you already setup feed burner feed(RSS feeds). If not you need to set it up now otherwise it won’t work. Actually I used this script for my site. Just go and have a look at it This is very tiny script so i will post entire script as single snippet code.

    <div id="result"></div>
    <script type="text/javascript">
      function posts(json) {
        var html = '<table><tr><th>#</th><th>Title</th><th>Post</th></tr>';
        for (var i in json.feed.entry) {
          var entry = json.feed.entry[i];
          var posttitle = entry.title.$t;
          var url =[4].href;
          html +=
            '<tr><td>' +
            i +
            '</td><td>' +
            posttitle +
            '</td><td><a href="' +
            url +
            '" target="_blank" title="" >Artical</a></td></tr>';
        html += '</table>';
        document.getElementById('result').innerHTML = html;
    <script src="//"></script>

In above code you just need to replace the with your blogger domain. That’s it you are done. Come to the code we are using blogger feed api and that will return you a big json code(just copy and past // your browser and see. we convert that code in to JavaScript object and did some looping to generate HTML(table). That’s it. It is very easy one. If you like it please share it.