My JQuery word excerpts

Excerpts every comments on the page:

<script>
$(function() {
$(“.comment”).each(function() {
str2= $(this).text().split(‘ ‘).slice(0,20).join(‘ ‘);
$(this).html(str2);

})
});
</script>

This helped me:

http://stackoverflow.com/questions/10936690/extract-first-n-words-from-string-jquery-wordpress-style-excerpt-in-jquery-x-n

this does not work:

http://beutelevision.com/blog2/2011/06/17/get-the-first-n-words-with-javascript/