Clear Links to Current Page with JavaScript
I’ve been wondering how to do this with the “Navigate” section of my sidebar for some time now. After all, it’s pointless to have a navigational link back to the page you’re already on. Snook.ca has the .js file to make it easy for you.
Because the masthead of each page on my blog also links back to the home page, I had to make a small change to the CSS to keep it looking consistent when this script stripped it of its link. Other than that, a very simple update to make.
Now, if I can only figure out how do do this with PHP I’ll really have something.
I’m not dissing Jonathan Snook’s JS solution here, I’d just rather do without the “blip” effect you see as the script does its thing after pageload.


With PHP, it would be a bit of a bitch. The quickest way would probably involve using the output buffer control and then parsing the entire generated page for links and stripping them out. Not much fun, really.
Comment by Chris Vincent — December 19, 2004 @ 2:43 pm
Yuck. Let’s file that under “things to try when I’m feeling masochistic.”
Comment by Adam M. — December 19, 2004 @ 3:20 pm