Tuesday, December 6, 2005

Disabling Links to the Current Page

According to Jakob Nielsen's list of The Ten Most Violated Homepage Design Guidelines, a link should never point to the current page.

I've seen high-profile sites that break this rule so I'd expect most users not to get too confused. Nevertheless, I whipped up some javascript to do disable links to the current page for this site. Ideally I'd like the links to be removed in the raw HTML and not require Javascript, but the way I've built my site makes this difficult.

A brief search revealed that some people do this by changing the onclick callback, and also the mouse cursor, but I prefer to replace the whole anchor tag with a span tag of a particular class.

No comments: