How to Make Recent Comment (Blogger)

This tutorial is for how to make recent comment using Javascript code.

1. Go to layout > Add Gadget > Choose HTML/Javascript > Copy And Paste Code Below

<ul><script style="text/javascript">
function showrecentcomments(json) {
for (var i = 0; i < 5; i++) {
var entry = json.feed.entry[i];
var ctlink;
if (i == json.feed.entry.length) break;
for (var k = 0; k <; k++) {
if ([k].rel == 'alternate') {
ctlink =[k].href;
ctlink = ctlink.replace("#", "#comment-");
var ptlink = ctlink.split("#");
ptlink = ptlink[0];
var txtlink = ptlink.split("/");
txtlink = txtlink[5];
txtlink = txtlink.split(".html");
txtlink = txtlink[0];
var pttitle = txtlink.replace(/-/g," ");
pttitle =;
if ("content" in entry) {
var comment = entry.content.$t;}
if ("summary" in entry) {
var comment = entry.summary.$t;}
else var comment = "";
var re = /<\S[^>]*>/g;
comment = comment.replace(re, "");
document.write('<a href="' + ctlink + '">' +[0].name.$t + '</a>');
document.write(' on ' + pttitle);
if (comment.length < 100) {
comment = comment.substring(0, 100);
var quoteEnd = comment.lastIndexOf(" ");
comment = comment.substring(0, quoteEnd);
document.write(comment + '...<a href="' + ctlink + '">(more)</a>');
document.write('<div style="font-size:75&percnt;;text-align:center"><a href="">Get this Widget</a></div>');
<script src="">
<noscript>You need to enable JavaScript to read this.</noscript>

2. Save And Done

Change URL with your blog URL


seo said...

Thanks for the sharing of such information. we will pass it on to our readers. This is a great reading. Thanking you. Affordable seo package

sana.ji said...

I suggest this site to my friends so it could be useful & informative for them also. Great effort.
do you know about this website
Send flowers to Canada

Alice Thomas said...
This comment has been removed by the author.
victor peterson said...
This comment has been removed by the author.
Ifat said...

thanks. this is very useful for me :)

logo bench said...

This is a Great Website You might find Fascinating that we Motivate A person.

Create a Cheap Logo

Lara baxter said...

Nice post i really glad to read this informative post, thanks to share :)

hosted pbx

Post a Comment