Add simple Recent Comment widget Powered by JASON

Add simple Recent Comment widget Powered by JASON
recent comment

Recent comment widget is very useful to display latest comments by Blog readers and author. It is good to see all latest comments in one place rather searching through different post. Those who are focusing on fast loading recent comment widget then this widget is perfect for them. Because in this widget I didn't use any image thumbnail of commentator, as a result this widget will load faster. In addition a simple but beautiful commentator default image has used that makes this simple widget attractive. For installing this JSON recent comment widget please follow the below steps properly.


Step 1 Log in to your Blogger account and Go to your Blogger Dashboard

Step 2 Go to your Layout tab.

Step 3 Click on "Add a Gadget" then select "HTML/JavaScript" Widget.

Step 4 Now Copy the below code and Paste it in "HTML/JavaScript" Gadget.

width: 98%;
margin-left: 7px;
margin-bottom: 7px;
#comment {
font:normal 100% Tahoma,Verdana,Arial,Sans-Serif;
margin:0px 0px;
padding:10px 10px;
border:4px solid #eeeeee;
-webkit-box-shadow:inset 0px 0px 2px #000;
-moz-box-shadow:inset 0px 0px 2px #000;
box-shadow:inset 0px 0px 2px #000;
#comment ul {
margin:0px 0px;
padding:0px 0px;
#comment ul li {
border-bottom:2px dashed #eeeeee;
padding:3px 0px;
#comment ul li b a,
#comment ul li b a:link,
#comment ul li b a:visited,
#comment ul li b {
text-shadow:0 1px 1px rgba(0,0,0,0.4);
#comment ul li b:before {
content: url(;
margin:0px 4px 0px 0px;
<div class="JASON-Montobbo">
<script type="text/javascript">
var numcomment = 5,
    numcharacter = 150,
    home_page   = "";
<script type='text/javascript'>
/* Blogger Quick JSON Search Result by*/
function displaycomment(json) {
        document.write('<div id="comment"><ul>');
        var entry, urlcomment, contcomment, showcomment;
        for (var i = 0; i < numcomment; i++) {
                entry = json.feed.entry[i];
        if (i == json.feed.entry.length) break;
                for (var k = 0; k <; k++) {
                        if ([k].rel == 'alternate') {
                                urlcomment =[k].href;
                urlcomment = urlcomment.replace("#", "#comment-");
                if ("content" in entry) {
                        contcomment = entry.content.$t
                } else if ("summary" in entry) {
                        contcomment = entry.summary.$t
                } else {
                        contcomment = ""

                var re = /<\S[^>]*>/g;
                contcomment = contcomment.replace(re, "");
                if (contcomment.length > numcharacter) {
                        contcomment = contcomment.substring(0, numcharacter) + "...";
                document.write('<b><a rel="nofollow" href="' + urlcomment + '">' +[0].name.$t + '</a>: </b>');
                document.write('<span class="cont">' + contcomment + '</span>');
document.write('<scr' + 'ipt src="' + home_page + '/feeds/comments/default?redirect=false&alt=json-in-script&callback=displaycomment"><\/script>');

Step 5 Now hit the Save button.


  • Change digit var numcomment = 5, for the number of comments you want to show.
  • Change digit numcharacter = 150,for the number of character you want to show.
  • Replace home_page   = "";  with your Blog URL

Now check your Blog and see the JSON powered recent comment widget which is very light weight to load. Thanks
Go Up