Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Free Nodelet Hack: linkify nodelet headings (for pmdev)

by jdporter (Canon)
on Jan 05, 2011 at 17:33 UTC ( #880646=note: print w/replies, xml ) Need Help??


in reply to Free Nodelet freed

This will turn each of the nodelet headings (titles) into links to the corresponding nodelet code nodes. (Only pmdev members are likely to find this useful.)

function linkify_nodelet_titles() { var nodelet_head_divs = getElementsOfTagAndClass( 'div', 'nodelet_he +ad' ); var i; for ( i = 0; i < nodelet_head_divs.length; i++ ) { var spans = nodelet_head_divs[i].getElementsByTagName('span'); var j; for ( j = 0; j < spans.length; j++ ) { if ( spans[j].className == 'title' ) { var title_span = spans[j]; var a = document.createElement('a'); a.href = 'http://perlmonks.org/?node=' + title_span.innerHTML; a.innerHTML = title_span.innerHTML; title_span.removeChild(title_span.firstChild); title_span.appendChild( a ); } } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://880646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2019-05-22 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (138 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!