There are a few less than perfect solutions:
1. Link to a fake anchor
<a href="#">
Problem: clicking the link jumps back to the top of the page
2. Using a tag other than 'a'
Use a span tag and use the jquery to handle the click
Problem: breaks keyboard navigation, have to manually change the hover cursor
3. Link to a javascript void function
<a href="javascript:void(0);">
<a href="javascript:;">
Problem: breaks when linking images in IE
Solution
Since these all have their problems, the solution I've settled on is to link to a fake anchor, and then return false from the onClick method:
<a href="#" onClick="return false;">
Not the most concise of solutions, but it solves all the problems with the above methods.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…