<script type='text/javascript'> function commentDisplay(json) { for (var i = 0; i &lt; numcomments; i++) { var entry = json.feed.entry[i]; var alturl; if (i == json.feed.entry.length) break; for (var k = 0; k &lt; entry.link.length; k++) { if (entry.link[k].rel == 'alternate') { alturl = entry.link[k].href; break; } } alturl = alturl.replace("#", "#comment-"); if (entry.content) { comment = entry.content.$t; } else if (entry.summary) { comment = entry.summary.$t; } var re = /&lt;\S[^&gt;]*&gt;/g; comment = comment.replace(re, ""); document.write('&lt;a href="' + alturl + '"&gt;' + entry.author[0].name.$t + '&lt;/a&gt; commented:&lt;br/&gt;'); if (comment.length &lt; numchars) document.write(comment + '&lt;br/&gt;&lt;br/&gt;'); else document.write(comment.substring(0, numchars) + '...&lt;br/&gt;&lt;br/&gt;'); } } </script>