Is there a better way to define anchor links that perform javascript other than using href="#"
? The main reason I dislike using this href is because it invalidates browser history. The back button just removes the "#" from the URL. If you use any type of Go Back link, it won't work unless they click it twice.
In cases where my Javascript is inlined, I can use href="javascript:func()"
, but this won't work when the listeners are attached from an external script file.
So I'm just looking for a cleaner direction to point my empty anchors.