DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Enlaces Entre Comentarios En Meneame.net (bookmarlet)

09.02.2006
| 3185 views |
  • submit to reddit
        Funciona como el script de anidar pero enlazando a los comentarios

javascript:(function() {var cl = document.getElementById("comments-list");var l = null;for(var i in cl.childNodes){l = cl.childNodes.item(i);if(l && (l.tagName) && (l.tagName.toUpperCase() == "LI")){var d = l.firstChild;var nc = parseInt(d.id.slice(8));var nr = 0;var o = d.firstChild.nextSibling.nextSibling;var t = o.innerHTML;var r = t.match(/#[0-9]+/g);for(var j in r){nr = parseInt(r[j].slice(1)); if((nr >0) && (nc > nr))o.innerHTML = t.replace(r[j],"<a href='" + document.URL.replace(/#comment.*$/g,"") + "#comment-" + nr + "'>" + r[j] +"</a>")}}}})(); void 0;