1. previous post: Business Links for Web Developers
  2. next post: The Redesign Cometh

Clear Links to Current Page with JavaScript

Filed under “Web Design & Development
by Adam at 12:37 PM on December 19, 2004

2 Comments

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.

Adam is a web developer and graphic designer who lives and works in south-central Kansas. He likes to speak his mind, both here and in his business blog. He only rarely writes about himself in the third person, honest. If you’d like to work with Adam, drop him a line.

2 Comments »

  1. 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

  2. Yuck. Let’s file that under “things to try when I’m feeling masochistic.”

    Comment by Adam M. — December 19, 2004 @ 3:20 pm

Say something, already

Line and paragraph breaks are automatic. Your e-mail address will never be published publicly unless you put it in your comment (and then I’d probably edit it out).

Please read my comment policy if this is your first time commenting here.

Required fields marked with *

*

* (never published)

Quicktags: