News for hackers. Stuff that matters.
Re:Ask HN: the current state of the empty # in 'a href' by d_r on Sunday March 27, 2011 @05:43AM (#2374622)
I usually tack on "return false;" to the onclick action to prevent the browser from actually navigating to '#'. Not sure if this is the recommended/best way, but it works.

E.g.

   <a href="#" onclick="doSomething(); return false;">test</a>

There are no comments on this comment yet.