Good idea, it'd be nice to have the node id easily accessible for each reply.
Put this snippet in your free nodelet - it'll add "#node_id" after the reply title (ie #581764 for this node).
<script language="javascript"><!--
function add_node_ids() {
var trs = document.getElementsByTagName('tr');
var i;
for ( i = 0; i < trs.length; i++ ) {
if ( trs[i].className == 'reply' ){
var anch = trs[i].getElementsByTagName( 'a' );
var id = anch[0].href.match( /\d+$/ );
var txt = document.createTextNode( " #" + id );
//or for [id://nnnnnn] style,
//var txt = document.createTextNode( " [id://" + id + "]" );
anch[0].parentNode.insertBefore( txt, anch[0].nextSibling
+);
}
}
}
add_node_ids();
</script><!-- end add_node_ids -->
Update: Tested on Firefox 1.507 & IE 6
Update 2: Only showed ids for new replies. Fixed to show id's for all replies. Added [id://nnnnnn].
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.