Why don't you add href='#' and return false from the click event. Nothing gets added to the history that way.
Better yet, add a href='/uri/to/script' as a fallback in case the user has JS disabled.
Better yet, add a href='/uri/to/script' as a fallback in case the user has JS disabled.
The href is not only for JS-less browsers, it's also for links opened in new tab or saved in browsing session.
By stopping propagation, you break delegation and make it impossible at worst and very random at best to add another handler to the same event.
Just use preventDefault o stop the browser from following the link.
Returning false is equivalent to calling both preventDefault()
(that's what you want) AND stopPropagation()
This is so in jQuery. In basic Javascript "return false" does not stop the propagation. See http://stackoverflow.com/questions/1357118/javascript-event-...